devices_test.dart 1.13 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/cache.dart';
7
import 'package:flutter_tools/src/commands/devices.dart';
8
import 'package:flutter_tools/src/device.dart';
9 10
import 'package:test/test.dart';

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

14
void main() {
15
  group('devices', () {
16 17 18 19
    setUpAll(() {
      Cache.disableLocking();
    });

20
    testUsingContext('returns 0 when called', () async {
21
      final DevicesCommand command = new DevicesCommand();
22
      await createTestCommandRunner(command).run(<String>['devices']);
23
    });
24

25
    testUsingContext('no error when no connected devices', () async {
26
      final DevicesCommand command = new DevicesCommand();
27 28
      await createTestCommandRunner(command).run(<String>['devices']);
      expect(testLogger.statusText, contains('No devices detected'));
29 30 31
    }, overrides: <Type, Generator>{
      AndroidSdk: () => null,
      DeviceManager: () => new DeviceManager(),
32 33 34
    });
  });
}