logs_test.dart 866 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// 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/base/common.dart';
6
import 'package:flutter_tools/src/cache.dart';
7
import 'package:flutter_tools/src/commands/logs.dart';
8

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

12
void main() {
13
  group('logs', () {
14 15 16 17 18 19 20 21
    setUp(() {
      Cache.disableLocking();
    });

    tearDown(() {
      Cache.enableLocking();
    });

22
    testUsingContext('fail with a bad device id', () async {
23
      final LogsCommand command = LogsCommand();
24 25 26 27 28 29
      try {
        await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']);
        fail('Expect exception');
      } on ToolExit catch (e) {
        expect(e.exitCode ?? 1, 1);
      }
30 31 32
    });
  });
}