Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willhlas committed Feb 28, 2023
1 parent 241e3f5 commit 74e154d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
27 changes: 26 additions & 1 deletion test/src/cli/flutter_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ void main() {
p.join(directory.path, 'test_plugin_four'),
)..createSync();

final ignoredDirectories = [
ignoredDirectory,
ignoredDirectoryTwo,
ignoredDirectoryThree,
ignoredDirectoryFour
];

File(p.join(nestedDirectory.path, 'pubspec.yaml'))
.writeAsStringSync(_pubspec);
File(p.join(ignoredDirectory.path, 'pubspec.yaml'))
Expand Down Expand Up @@ -218,9 +225,27 @@ void main() {
).whenComplete(() {
verify(() {
logger.progress(
any(that: contains('Running "flutter packages get" in')),
any(
that: contains(
'Running "flutter packages get" in '
'${nestedDirectory.path}',
),
),
);
}).called(1);

for (final directory in ignoredDirectories) {
verifyNever(() {
logger.progress(
any(
that: contains(
'Running "flutter packages get" in '
'${directory.path}',
),
),
);
});
}
});
},
);
Expand Down
15 changes: 14 additions & 1 deletion test/src/commands/packages_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,22 @@ void main() {
expect(result, equals(ExitCode.success.code));
verify(() {
logger.progress(
any(that: contains('Running "flutter packages get" in')),
any(
that: contains(
'Running "flutter packages get" in ${directoryA.path}',
),
),
);
}).called(1);
verifyNever(() {
logger.progress(
any(
that: contains(
'Running "flutter packages get" in ${directoryB.path}',
),
),
);
});
}),
);
});
Expand Down

0 comments on commit 74e154d

Please sign in to comment.