devices.test.dart 1.09 KB
Newer Older
1 2 3 4
// 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.

5
import 'package:flutter_tools/src/android/android_sdk.dart';
6
import 'package:flutter_tools/src/commands/devices.dart';
7
import 'package:flutter_tools/src/device.dart';
8 9
import 'package:test/test.dart';

10 11
import 'src/common.dart';
import 'src/context.dart';
12

13
void main() {
14
  group('devices', () {
15
    testUsingContext('returns 0 when called', () {
16
      DevicesCommand command = new DevicesCommand();
17 18 19 20
      return createTestCommandRunner(command).run(['list']).then((int code) {
        expect(code, equals(0));
      });
    });
21

22
    testUsingContext('no error when no connected devices', () {
23
      DevicesCommand command = new DevicesCommand();
24 25 26 27 28 29 30
      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()
31 32 33
    });
  });
}