Test install command
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart
index 3167abb..510e51c 100644
--- a/packages/flutter_tools/lib/src/device.dart
+++ b/packages/flutter_tools/lib/src/device.dart
@@ -52,7 +52,7 @@
@override
bool installApp(String path) {
- return false;
+ return true;
}
@override
diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml
index 995f1b9..c86a20a 100644
--- a/packages/flutter_tools/pubspec.yaml
+++ b/packages/flutter_tools/pubspec.yaml
@@ -16,6 +16,9 @@
shelf_static: ^0.2.3
test: ">=0.12.4+5 <0.12.5"
+dev_dependencies:
+ mockito: "^0.10.1"
+
# Add the bin/sky_tools.dart script to the scripts pub installs.
executables:
sky_tools:
diff --git a/packages/flutter_tools/test/install_test.dart b/packages/flutter_tools/test/install_test.dart
new file mode 100644
index 0000000..5e51c20
--- /dev/null
+++ b/packages/flutter_tools/test/install_test.dart
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+library install_test;
+
+import 'package:args/args.dart';
+import 'package:mockito/mockito.dart';
+import 'package:sky_tools/src/install.dart';
+import 'package:test/test.dart';
+
+main() => defineTests();
+
+defineTests() {
+ group('install', () {
+ test('install returns 0', () {
+ MockArgResults results = new MockArgResults();
+ when(results['help']).thenReturn(false);
+ InstallCommandHandler handler = new InstallCommandHandler();
+ handler
+ .processArgResults(results)
+ .then((int code) => expect(code, equals(0)));
+ });
+ });
+}
+
+@proxy
+class MockArgResults extends Mock implements ArgResults {
+ @override
+ dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}