[flutter_conductor] Refactor next command (#91768)

This commit is contained in:
Christopher Fujino
2021-10-14 11:04:40 -07:00
committed by GitHub
parent 7a7d9a276a
commit 5d587f9528
2 changed files with 366 additions and 316 deletions

View File

@@ -1052,6 +1052,34 @@ void main() {
}, onPlatform: <String, dynamic>{
'windows': const Skip('Flutter Conductor only supported on macos/linux'),
});
group('prompt', () {
test('throws if user inputs character that is not "y" or "n"', () {
final FileSystem fileSystem = MemoryFileSystem.test();
final TestStdio stdio = TestStdio(
stdin: <String>['x'],
verbose: true,
);
final Checkouts checkouts = Checkouts(
fileSystem: fileSystem,
parentDirectory: fileSystem.directory('/'),
platform: FakePlatform(),
processManager: FakeProcessManager.empty(),
stdio: stdio,
);
final NextContext context = NextContext(
autoAccept: false,
force: false,
checkouts: checkouts,
stateFile: fileSystem.file('/statefile.json'),
);
expect(
() => context.prompt('Asking a question?', stdio),
throwsExceptionWith('Unknown user input (expected "y" or "n")'),
);
});
});
}
void _initializeCiYamlFile(