allow any android sdk version
diff --git a/packages/flutter_tools/test/stop_test.dart b/packages/flutter_tools/test/stop_test.dart index f700e3b..0c0c08e 100644 --- a/packages/flutter_tools/test/stop_test.dart +++ b/packages/flutter_tools/test/stop_test.dart
@@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:args/command_runner.dart'; import 'package:flutter_tools/src/commands/stop.dart'; import 'package:mockito/mockito.dart'; import 'package:test/test.dart'; +import 'src/common.dart'; +import 'src/context.dart'; import 'src/mocks.dart'; main() => defineTests(); defineTests() { group('stop', () { - test('returns 0 when Android is connected and ready to be stopped', () { + testUsingContext('returns 0 when Android is connected and ready to be stopped', () { StopCommand command = new StopCommand(); applyMocksToCommand(command); MockDeviceStore mockDevices = command.devices; @@ -27,12 +28,12 @@ when(mockDevices.iOSSimulator.isConnected()).thenReturn(false); when(mockDevices.iOSSimulator.stopApp(any)).thenReturn(false); - CommandRunner runner = new CommandRunner('test_flutter', '') - ..addCommand(command); - return runner.run(['stop']).then((int code) => expect(code, equals(0))); + return createTestCommandRunner(command).run(['stop']).then((int code) { + expect(code, equals(0)); + }); }); - test('returns 0 when iOS is connected and ready to be stopped', () { + testUsingContext('returns 0 when iOS is connected and ready to be stopped', () { StopCommand command = new StopCommand(); applyMocksToCommand(command); MockDeviceStore mockDevices = command.devices; @@ -46,9 +47,9 @@ when(mockDevices.iOSSimulator.isConnected()).thenReturn(false); when(mockDevices.iOSSimulator.stopApp(any)).thenReturn(false); - CommandRunner runner = new CommandRunner('test_flutter', '') - ..addCommand(command); - return runner.run(['stop']).then((int code) => expect(code, equals(0))); + return createTestCommandRunner(command).run(['stop']).then((int code) { + expect(code, equals(0)); + }); }); }); }