OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library pubspec_test; | 5 library pubspec_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 | 8 |
9 import '../lib/src/pubspec.dart'; | 9 import '../lib/src/pubspec.dart'; |
10 import '../lib/src/source.dart'; | 10 import '../lib/src/source.dart'; |
11 import '../lib/src/source_registry.dart'; | 11 import '../lib/src/source_registry.dart'; |
12 import '../lib/src/utils.dart'; | |
13 import '../lib/src/version.dart'; | 12 import '../lib/src/version.dart'; |
14 import 'test_pub.dart'; | 13 import 'test_pub.dart'; |
15 | 14 |
16 class MockSource extends Source { | 15 class MockSource extends Source { |
17 final String name = "mock"; | 16 final String name = "mock"; |
18 final bool shouldCache = false; | 17 final bool shouldCache = false; |
19 dynamic parseDescription(String filePath, description, | 18 dynamic parseDescription(String filePath, description, |
20 {bool fromLockFile: false}) { | 19 {bool fromLockFile: false}) { |
21 if (description != 'ok') throw new FormatException('Bad'); | 20 if (description != 'ok') throw new FormatException('Bad'); |
22 return description; | 21 return description; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 214 |
216 test("throws if the sdk isn't a valid version constraint", () { | 215 test("throws if the sdk isn't a valid version constraint", () { |
217 expectFormatError(''' | 216 expectFormatError(''' |
218 environment: | 217 environment: |
219 sdk: "oopies" | 218 sdk: "oopies" |
220 '''); | 219 '''); |
221 }); | 220 }); |
222 }); | 221 }); |
223 }); | 222 }); |
224 } | 223 } |
OLD | NEW |