2016-08-25 19:16:21 +00:00
|
|
|
// 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';
|
2017-03-10 17:39:01 +00:00
|
|
|
import 'package:flutter_tools/src/cache.dart';
|
2016-08-25 19:16:21 +00:00
|
|
|
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', () {
|
2017-03-10 17:39:01 +00:00
|
|
|
setUpAll(() {
|
|
|
|
Cache.disableLocking();
|
|
|
|
});
|
|
|
|
|
2016-08-25 19:16:21 +00:00
|
|
|
testUsingContext('list', () async {
|
2017-03-04 01:50:46 +00:00
|
|
|
final ChannelCommand command = new ChannelCommand();
|
|
|
|
final CommandRunner<Null> runner = createTestCommandRunner(command);
|
2016-11-14 19:21:30 +00:00
|
|
|
await runner.run(<String>['channel']);
|
|
|
|
expect(testLogger.errorText, hasLength(0));
|
2016-09-02 02:05:03 +00:00
|
|
|
// 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.
|
2016-11-14 19:21:30 +00:00
|
|
|
expect(testLogger.statusText, contains('Flutter channels:'));
|
2016-08-25 19:16:21 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|