channel_test.dart 1.05 KB
Newer Older
1 2 3 4 5
// 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.

import 'package:args/command_runner.dart';
6
import 'package:flutter_tools/src/cache.dart';
7 8 9 10 11 12 13 14
import 'package:flutter_tools/src/commands/channel.dart';
import 'package:test/test.dart';

import 'src/common.dart';
import 'src/context.dart';

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

19
    testUsingContext('list', () async {
20 21
      final ChannelCommand command = new ChannelCommand();
      final CommandRunner<Null> runner = createTestCommandRunner(command);
22 23
      await runner.run(<String>['channel']);
      expect(testLogger.errorText, hasLength(0));
24 25 26
      // The bots may return an empty list of channels (network hiccup?)
      // and when run locally the list of branches might be different
      // so we check for the header text rather than any specific channel name.
27
      expect(testLogger.statusText, contains('Flutter channels:'));
28 29 30
    });
  });
}