Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit b9b55ab

Browse files
authored
test: remove unused PubUpdater (#82)
* docs: optioon to option * refactor: PubUpdater is useless in SampleCommandTest
1 parent 39847b7 commit b9b55ab

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/my_cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dart pub global activate --source=path <path to this package>
3030
# Sample command
3131
$ my_executable sample
3232

33-
# Sample command optioon
33+
# Sample command option
3434
$ my_executable sample --cyan
3535

3636
# Show CLI version

src/my_cli/test/src/commands/sample_command_test.dart

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
import 'package:mason_logger/mason_logger.dart';
22
import 'package:mocktail/mocktail.dart';
33
import 'package:my_cli/src/command_runner.dart';
4-
import 'package:my_cli/src/version.dart';
5-
import 'package:pub_updater/pub_updater.dart';
64
import 'package:test/test.dart';
75

86
class _MockLogger extends Mock implements Logger {}
97

10-
class _MockPubUpdater extends Mock implements PubUpdater {}
11-
128
void main() {
139
group('sample', () {
14-
late PubUpdater pubUpdater;
1510
late Logger logger;
1611
late MyCLICommandRunner commandRunner;
1712

1813
setUp(() {
19-
pubUpdater = _MockPubUpdater();
20-
21-
when(
22-
() => pubUpdater.getLatestVersion(any()),
23-
).thenAnswer((_) async => packageVersion);
24-
2514
logger = _MockLogger();
26-
commandRunner = MyCLICommandRunner(
27-
logger: logger,
28-
pubUpdater: pubUpdater,
29-
);
15+
commandRunner = MyCLICommandRunner(logger: logger);
3016
});
3117

3218
test('tells a joke', () async {

0 commit comments

Comments
 (0)