| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library test.context.directory.manager; |
| 6 |
| 7 import 'package:analysis_server/src/context_directory_manager.dart'; |
| 8 import 'package:analysis_server/src/resource.dart'; |
| 9 import 'package:unittest/unittest.dart'; |
| 10 |
| 11 class TestContextDirectoryManager extends ContextDirectoryManager { |
| 12 TestContextDirectoryManager(MemoryResourceProvider provider) : super(provider)
; |
| 13 |
| 14 final Set<String> currentContextPaths = new Set<String>(); |
| 15 |
| 16 @override |
| 17 void addContext(Folder folder) { |
| 18 currentContextPaths.add(folder.fullName); |
| 19 } |
| 20 } |
| 21 |
| 22 main() { |
| 23 groupSep = ' | '; |
| 24 |
| 25 group('ContextDirectoryManager', () { |
| 26 TestContextDirectoryManager manager; |
| 27 MemoryResourceProvider provider; |
| 28 |
| 29 setUp(() { |
| 30 provider = new MemoryResourceProvider(); |
| 31 manager = new TestContextDirectoryManager(provider); |
| 32 }); |
| 33 |
| 34 test('add folder with pubspec', () { |
| 35 provider.newFile('/my/proj/pubspec.yaml', 'pubspec'); |
| 36 manager.setRoots(<String>['/my/proj'], <String>[]); |
| 37 expect(manager.currentContextPaths, hasLength(1)); |
| 38 expect(manager.currentContextPaths, contains('/my/proj')); |
| 39 }); |
| 40 }); |
| 41 } |
| OLD | NEW |