Index: test/driver_test.dart |
diff --git a/test/driver_test.dart b/test/driver_test.dart |
index 0e6419ae19dbc690bf8298e240370b3d96b07e9b..ae67508c1025364e77ade9ad4fe3c750345828c4 100644 |
--- a/test/driver_test.dart |
+++ b/test/driver_test.dart |
@@ -8,6 +8,7 @@ library analyzer_cli.test.driver; |
import 'dart:io'; |
import 'package:analyzer/plugin/options.dart'; |
+import 'package:analyzer_cli/src/bootloader.dart'; |
import 'package:analyzer_cli/src/driver.dart'; |
import 'package:linter/src/plugin/linter_plugin.dart'; |
import 'package:path/path.dart' as path; |
@@ -30,39 +31,6 @@ main() { |
expect(processor.options['test_plugin'], isNotNull); |
expect(processor.exception, isNull); |
}); |
- group('plugin processing', () { |
- StringSink savedErrorSink; |
- setUp(() { |
- savedErrorSink = errorSink; |
- errorSink = new StringBuffer(); |
- }); |
- tearDown(() { |
- errorSink = savedErrorSink; |
- }); |
- test('bad format', () { |
- Driver driver = new Driver(); |
- driver.start([ |
- '--options', |
- 'test/data/bad_plugin_options.yaml', |
- 'test/data/test_file.dart' |
- ]); |
- expect( |
- errorSink.toString(), |
- equals( |
- 'Plugin configuration skipped: Unrecognized plugin config format, expected `YamlMap`, got `YamlList` (line 2, column 4)\n')); |
- }); |
- test('plugin config', () { |
- Driver driver = new Driver(); |
- driver.start([ |
- '--options', |
- 'test/data/plugin_options.yaml', |
- 'test/data/test_file.dart' |
- ]); |
- var plugins = driver.pluginConfig.plugins; |
- expect(plugins, hasLength(1)); |
- expect(plugins.first.name, equals('my_plugin1')); |
- }); |
- }); |
}); |
group('linter', () { |
@@ -151,6 +119,41 @@ main() {} |
}); |
}); |
}); |
+ group('Bootloader', () { |
+ group('plugin processing', () { |
+ StringSink savedErrorSink; |
+ setUp(() { |
+ savedErrorSink = errorSink; |
+ errorSink = new StringBuffer(); |
+ }); |
+ tearDown(() { |
+ errorSink = savedErrorSink; |
+ }); |
+ test('bad format', () { |
+ BootLoader loader = new BootLoader(); |
+ loader.createImage([ |
+ '--options', |
+ 'test/data/bad_plugin_options.yaml', |
+ 'test/data/test_file.dart' |
+ ]); |
+ expect( |
+ errorSink.toString(), |
+ equals( |
+ 'Plugin configuration skipped: Unrecognized plugin config format, expected `YamlMap`, got `YamlList` (line 2, column 4)\n')); |
+ }); |
+ test('plugin config', () { |
+ BootLoader loader = new BootLoader(); |
+ Image image = loader.createImage([ |
+ '--options', |
+ 'test/data/plugin_options.yaml', |
+ 'test/data/test_file.dart' |
+ ]); |
+ var plugins = image.config.plugins; |
+ expect(plugins, hasLength(1)); |
+ expect(plugins.first.name, equals('my_plugin1')); |
+ }); |
+ }); |
+ }); |
} |
class TestPlugin extends Plugin { |