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 lock_file_test; | 5 library lock_file_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'package:yaml/yaml.dart'; | 8 import 'package:yaml/yaml.dart'; |
9 | 9 |
10 import '../lib/src/lock_file.dart'; | 10 import '../lib/src/lock_file.dart'; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 packages: | 82 packages: |
83 foo: | 83 foo: |
84 source: bad | 84 source: bad |
85 version: 1.2.3 | 85 version: 1.2.3 |
86 description: foo desc | 86 description: foo desc |
87 ''', sources); | 87 ''', sources); |
88 var foo = lockFile.packages['foo']; | 88 var foo = lockFile.packages['foo']; |
89 expect(foo.source, equals('bad')); | 89 expect(foo.source, equals('bad')); |
90 }); | 90 }); |
91 | 91 |
| 92 test("allows an empty dependency map", () { |
| 93 var lockFile = new LockFile.parse(''' |
| 94 packages: |
| 95 ''', sources); |
| 96 expect(lockFile.packages, isEmpty); |
| 97 }); |
| 98 |
92 test("throws if the version is missing", () { | 99 test("throws if the version is missing", () { |
93 expect(() { | 100 expect(() { |
94 new LockFile.parse(''' | 101 new LockFile.parse(''' |
95 packages: | 102 packages: |
96 foo: | 103 foo: |
97 source: mock | 104 source: mock |
98 description: foo desc | 105 description: foo desc |
99 ''', sources); | 106 ''', sources); |
100 }, throwsFormatException); | 107 }, throwsFormatException); |
101 }); | 108 }); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 'version': '3.2.1', | 190 'version': '3.2.1', |
184 'source': 'mock', | 191 'source': 'mock', |
185 'description': 'bar desc' | 192 'description': 'bar desc' |
186 } | 193 } |
187 } | 194 } |
188 })); | 195 })); |
189 }); | 196 }); |
190 }); | 197 }); |
191 }); | 198 }); |
192 } | 199 } |
OLD | NEW |