devices_test.dart 1.1 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
      return createTestCommandRunner(command).run(<String>['devices']).then((int code) {
18
        expect(code, 0);
19 20
      });
    });
21

22
    testUsingContext('no error when no connected devices', () {
23
      DevicesCommand command = new DevicesCommand();
24
      return createTestCommandRunner(command).run(<String>['devices']).then((int code) {
25
        expect(code, 0);
26
        expect(testLogger.statusText, contains('No devices detected'));
27 28 29 30
      });
    }, overrides: <Type, dynamic>{
      AndroidSdk: null,
      DeviceManager: new DeviceManager()
31 32 33
    });
  });
}