Index: pkg/barback/test/utils.dart |
diff --git a/pkg/barback/test/utils.dart b/pkg/barback/test/utils.dart |
index 7da5977e9b7a80561ea521a74f841a8b21f23ad5..4c39848c1b9cc80c22fc05baba1999ec43f50b95 100644 |
--- a/pkg/barback/test/utils.dart |
+++ b/pkg/barback/test/utils.dart |
@@ -249,9 +249,10 @@ Future<LogEntry> _getNextLog(String description) { |
/// Schedules an expectation that the graph will deliver an asset matching |
/// [name] and [contents]. |
/// |
-/// If [contents] is omitted, defaults to the asset's filename without an |
-/// extension (which is the same default that [initGraph] uses). |
-void expectAsset(String name, [String contents]) { |
+/// [contents] may be a [String] or a [Matcher] that matches a string. If |
+/// [contents] is omitted, defaults to the asset's filename without an extension |
+/// (which is the same default that [initGraph] uses). |
+void expectAsset(String name, [contents]) { |
var id = new AssetId.parse(name); |
if (contents == null) { |
@@ -262,7 +263,7 @@ void expectAsset(String name, [String contents]) { |
return _barback.getAssetById(id).then((asset) { |
// TODO(rnystrom): Make an actual Matcher class for this. |
expect(asset.id, equals(id)); |
- expect(asset.readAsString(), completion(equals(contents))); |
+ expect(asset.readAsString(), completion(contents)); |
}); |
}, "get asset $name"); |
} |