-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsome_other_command_test.dart
More file actions
36 lines (29 loc) · 987 Bytes
/
some_other_command_test.dart
File metadata and controls
36 lines (29 loc) · 987 Bytes
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
import 'package:example/src/command_runner.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
class MockLogger extends Mock implements Logger {}
void main() {
group('SomeOtherCommand', () {
late Logger logger;
late ExampleCommandRunner commandRunner;
setUp(() {
logger = MockLogger();
commandRunner = ExampleCommandRunner(
logger: logger,
);
});
test('list passed options', () async {
final exitCode = await commandRunner.run(
'some_other_command subcommand anything after command '.split(' '),
);
expect(exitCode, ExitCode.success.code);
verify(
() => logger.info('A sub command of some_other_command'),
).called(1);
verify(() => logger.info(' - anything')).called(1);
verify(() => logger.info(' - after')).called(1);
verify(() => logger.info(' - command')).called(1);
});
});
}