Index: sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart |
diff --git a/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart b/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart |
index e77af93391e3367b814c17ab9fb7614a50c506e1..2f0cfe63a59812d1f644772a59f7a13a204aae28 100644 |
--- a/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart |
+++ b/sdk/lib/_internal/pub/test/serve/warns_on_assets_paths_test.dart |
@@ -5,6 +5,7 @@ |
library pub_tests; |
import 'package:path/path.dart' as path; |
+import 'package:scheduled_test/scheduled_stream.dart'; |
import 'package:scheduled_test/scheduled_test.dart'; |
import '../../lib/src/utils.dart'; |
@@ -16,7 +17,7 @@ getWarningRegExp(String assetsPath) { |
// Escape backslashes since they are metacharacters in a regex. |
assetsPath = quoteRegExp(assetsPath); |
return new RegExp( |
- '^Warning: Pub reserves paths containing "assets" for using assets from ' |
+ r'^Warning: Pub reserves paths containing "assets" for using assets from ' |
'packages\\. Please rename the path "$assetsPath"\\.\$'); |
} |
@@ -37,8 +38,7 @@ main() { |
endPubServe(); |
var assetsPath = path.join('web', 'assets'); |
- expect(pub.remainingStderr(), completion( |
- matches(getWarningRegExp(assetsPath)))); |
+ pub.stderr.expect(consumeThrough(matches(getWarningRegExp(assetsPath)))); |
}); |
integration('warns user about assets dir nested anywhere in "web"', () { |
@@ -57,8 +57,7 @@ main() { |
endPubServe(); |
var assetsPath = path.join('web', 'foo', 'assets'); |
- expect(pub.remainingStderr(), completion( |
- matches(getWarningRegExp(assetsPath)))); |
+ pub.stderr.expect(consumeThrough(matches(getWarningRegExp(assetsPath)))); |
}); |
integration('warns user about assets file in the root of "web"', () { |
@@ -75,8 +74,7 @@ main() { |
endPubServe(); |
var assetsPath = path.join('web', 'assets'); |
- expect(pub.remainingStderr(), completion( |
- matches(getWarningRegExp(assetsPath)))); |
+ pub.stderr.expect(consumeThrough(matches(getWarningRegExp(assetsPath)))); |
}); |
integration('warns user about assets file nested anywhere in "web"', () { |
@@ -95,8 +93,7 @@ main() { |
endPubServe(); |
var assetsPath = path.join('web', 'foo', 'assets'); |
- expect(pub.remainingStderr(), completion( |
- matches(getWarningRegExp(assetsPath)))); |
+ pub.stderr.expect(consumeThrough(matches(getWarningRegExp(assetsPath)))); |
}); |
integration('does not warn if no assets dir or file anywhere in "web"', () { |
@@ -112,7 +109,7 @@ main() { |
waitForBuildSuccess(); |
endPubServe(); |
- expect(pub.remainingStderr(), completion( |
- matches(r'^(?!Warning: Pub reserves paths containing "assets").*$'))); |
+ pub.stderr.expect(never(startsWith('Warning: Pub reserves paths containing ' |
+ '"assets"'))); |
}); |
} |