Replace MockUsage with Usage.test in build tests (#67670)
This commit is contained in:
@@ -92,6 +92,18 @@ CommandRunner<void> createTestCommandRunner([ FlutterCommand command ]) {
|
||||
return runner;
|
||||
}
|
||||
|
||||
/// Capture console print events into a string buffer.
|
||||
Future<StringBuffer> capturedConsolePrint(Future<void> Function() body) async {
|
||||
final StringBuffer buffer = StringBuffer();
|
||||
await runZoned<Future<void>>(() async {
|
||||
// Service the event loop.
|
||||
await body();
|
||||
}, zoneSpecification: ZoneSpecification(print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
|
||||
buffer.writeln(line);
|
||||
}));
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/// Matcher for functions that throw [AssertionError].
|
||||
final Matcher throwsAssertionError = throwsA(isA<AssertionError>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user