-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathcheck_test.dart
More file actions
51 lines (43 loc) · 1.51 KB
/
check_test.dart
File metadata and controls
51 lines (43 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import 'dart:collection';
import 'package:mason_logger/mason_logger.dart';
import 'package:test/test.dart';
import 'package:very_good_cli/src/commands/packages/commands/check/check.dart';
import '../../../../../helpers/helpers.dart';
const _expectedPackagesCheckUsage = [
// ignore: no_adjacent_strings_in_list
'Perform checks in a Dart or Flutter project.\n'
'\n'
'Usage: very_good packages check <subcommand> [arguments]\n'
'-h, --help Print this usage information.\n'
'\n'
'Available subcommands:\n'
' licenses Check packages licenses in a Dart or Flutter project.\n'
'\n'
'Run "very_good help" to see global options.'
];
void main() {
group('packages check licenses', () {
final commandArguments = UnmodifiableListView(
['packages', 'check'],
);
test(
'help',
withRunner(
(commandRunner, logger, pubUpdater, pubLicense, printLogs) async {
final result = await commandRunner.run(
[...commandArguments, '--help'],
);
expect(printLogs, equals(_expectedPackagesCheckUsage));
expect(result, equals(ExitCode.success.code));
printLogs.clear();
final resultAbbr = await commandRunner.run([...commandArguments, '-h']);
expect(printLogs, equals(_expectedPackagesCheckUsage));
expect(resultAbbr, equals(ExitCode.success.code));
}),
);
test('is hidden', () {
final command = PackagesCheckCommand();
expect(command.hidden, isTrue);
});
});
}