logs_test.dart 933 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 11
import '../../src/common.dart';
import '../../src/context.dart';
import '../../src/mocks.dart';
12

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

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

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