@@ -71,28 +71,6 @@ void main() {
71
71
FlutterVersion : () => mockVersion,
72
72
});
73
73
74
- testUsingContext ('dev version switch prompt is accepted' , () async {
75
- when (mockStdio.stdinHasTerminal).thenReturn (true );
76
- const String version = '30.0.0-dev.0.0' ;
77
- final VersionCommand command = VersionCommand ();
78
- when (globals.terminal.promptForCharInput (< String > ['y' , 'n' ],
79
- logger: anyNamed ('logger' ),
80
- prompt: 'Are you sure you want to proceed?' )
81
- ).thenAnswer ((Invocation invocation) async => 'y' );
82
-
83
- await createTestCommandRunner (command).run (< String > [
84
- 'version' ,
85
- '--no-pub' ,
86
- version,
87
- ]);
88
- expect (testLogger.statusText, contains ('Switching Flutter to version $version ' ));
89
- }, overrides: < Type , Generator > {
90
- ProcessManager : () => MockProcessManager (),
91
- Stdio : () => mockStdio,
92
- AnsiTerminal : () => MockTerminal (),
93
- FlutterVersion : () => mockVersion,
94
- });
95
-
96
74
testUsingContext ('version switch prompt is declined' , () async {
97
75
when (mockStdio.stdinHasTerminal).thenReturn (true );
98
76
const String version = '10.0.0' ;
@@ -261,7 +239,7 @@ class MockProcessManager extends Mock implements ProcessManager {
261
239
return ProcessResult (0 , 0 , 'v10.0.0\r\n v20.0.0\r\n 30.0.0-dev.0.0' , '' );
262
240
}
263
241
if (command[0 ] == 'git' && command[1 ] == 'checkout' ) {
264
- version = (command[2 ] as String ).replaceFirst (RegExp ( '^v' ) , '' );
242
+ version = (command[2 ] as String ).replaceFirst ('v' , '' );
265
243
}
266
244
return ProcessResult (0 , 0 , '' , '' );
267
245
}
0 commit comments