2015-09-30 22:24:39 +00:00
|
|
|
// 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.
|
|
|
|
|
2016-02-13 20:00:41 +00:00
|
|
|
import 'package:flutter_tools/src/android/android_sdk.dart';
|
2016-02-14 07:50:20 +00:00
|
|
|
import 'package:flutter_tools/src/commands/devices.dart';
|
2016-02-13 20:00:41 +00:00
|
|
|
import 'package:flutter_tools/src/device.dart';
|
2015-09-30 22:24:39 +00:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
2016-02-13 20:00:41 +00:00
|
|
|
import 'src/common.dart';
|
|
|
|
import 'src/context.dart';
|
2015-09-30 22:24:39 +00:00
|
|
|
|
2016-03-10 01:43:14 +00:00
|
|
|
void main() {
|
2016-02-14 07:50:20 +00:00
|
|
|
group('devices', () {
|
2016-02-07 03:19:50 +00:00
|
|
|
testUsingContext('returns 0 when called', () {
|
2016-02-14 07:50:20 +00:00
|
|
|
DevicesCommand command = new DevicesCommand();
|
2016-02-13 20:00:41 +00:00
|
|
|
return createTestCommandRunner(command).run(['list']).then((int code) {
|
|
|
|
expect(code, equals(0));
|
|
|
|
});
|
|
|
|
});
|
2015-10-12 02:42:50 +00:00
|
|
|
|
2016-02-13 20:00:41 +00:00
|
|
|
testUsingContext('no error when no connected devices', () {
|
2016-02-14 07:50:20 +00:00
|
|
|
DevicesCommand command = new DevicesCommand();
|
2016-02-13 20:00:41 +00:00
|
|
|
return createTestCommandRunner(command).run(['list']).then((int code) {
|
|
|
|
expect(code, equals(0));
|
|
|
|
expect(testLogger.statusText, contains('No connected devices'));
|
|
|
|
});
|
|
|
|
}, overrides: <Type, dynamic>{
|
|
|
|
AndroidSdk: null,
|
|
|
|
DeviceManager: new DeviceManager()
|
2015-09-30 22:24:39 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|