Remove a sketchy override of a field (#6009)

The way this was implemented is sketchy, especially in strong mode.
This commit is contained in:
Ian Hickson
2016-09-22 16:07:56 -07:00
committed by GitHub
parent 2dc26ba986
commit 7a0f3d3405

View File

@@ -36,6 +36,17 @@ class TestCommand extends FlutterCommand {
defaultsTo: 'coverage/lcov.info',
help: 'Where to store coverage information (if coverage is enabled).'
);
commandValidator = () {
if (!FileSystemEntity.isFileSync('pubspec.yaml')) {
printError(
'Error: No pubspec.yaml file found in the current working directory.\n'
'Run this command from the root of your project. Test files must be\n'
'called *_test.dart and must reside in the package\'s \'test\'\n'
'directory (or one of its subdirectories).');
return false;
}
return true;
};
}
@override
@@ -44,19 +55,6 @@ class TestCommand extends FlutterCommand {
@override
String get description => 'Run Flutter unit tests for the current project.';
@override
Validator commandValidator = () {
if (!FileSystemEntity.isFileSync('pubspec.yaml')) {
printError(
'Error: No pubspec.yaml file found in the current working directory.\n'
'Run this command from the root of your project. Test files must be\n'
'called *_test.dart and must reside in the package\'s \'test\'\n'
'directory (or one of its subdirectories).');
return false;
}
return true;
};
Iterable<String> _findTests(Directory directory) {
return directory.listSync(recursive: true, followLinks: false)
.where((FileSystemEntity entity) => entity.path.endsWith('_test.dart') &&