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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 setUp(() { | 172 setUp(() { |
173 lockfile = new LockFile.empty(); | 173 lockfile = new LockFile.empty(); |
174 }); | 174 }); |
175 | 175 |
176 test('dumps the lockfile to YAML', () { | 176 test('dumps the lockfile to YAML', () { |
177 lockfile.packages['foo'] = new PackageId( | 177 lockfile.packages['foo'] = new PackageId( |
178 'foo', mockSource.name, new Version.parse('1.2.3'), 'foo desc'); | 178 'foo', mockSource.name, new Version.parse('1.2.3'), 'foo desc'); |
179 lockfile.packages['bar'] = new PackageId( | 179 lockfile.packages['bar'] = new PackageId( |
180 'bar', mockSource.name, new Version.parse('3.2.1'), 'bar desc'); | 180 'bar', mockSource.name, new Version.parse('3.2.1'), 'bar desc'); |
181 | 181 |
182 expect(loadYaml(lockfile.serialize()), equals({ | 182 expect(loadYaml(lockfile.serialize(null, sources)), equals({ |
183 'packages': { | 183 'packages': { |
184 'foo': { | 184 'foo': { |
185 'version': '1.2.3', | 185 'version': '1.2.3', |
186 'source': 'mock', | 186 'source': 'mock', |
187 'description': 'foo desc' | 187 'description': 'foo desc' |
188 }, | 188 }, |
189 'bar': { | 189 'bar': { |
190 'version': '3.2.1', | 190 'version': '3.2.1', |
191 'source': 'mock', | 191 'source': 'mock', |
192 'description': 'bar desc' | 192 'description': 'bar desc' |
193 } | 193 } |
194 } | 194 } |
195 })); | 195 })); |
196 }); | 196 }); |
197 }); | 197 }); |
198 }); | 198 }); |
199 } | 199 } |
OLD | NEW |