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 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:pub/src/lock_file.dart'; | 9 import 'package:pub/src/lock_file.dart'; |
10 import 'package:pub/src/package.dart'; | 10 import 'package:pub/src/package.dart'; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 }); | 196 }); |
197 | 197 |
198 test('serialize() dumps the lockfile to YAML', () { | 198 test('serialize() dumps the lockfile to YAML', () { |
199 var lockfile = new LockFile([ | 199 var lockfile = new LockFile([ |
200 new PackageId( | 200 new PackageId( |
201 'foo', mockSource.name, new Version.parse('1.2.3'), 'foo desc'), | 201 'foo', mockSource.name, new Version.parse('1.2.3'), 'foo desc'), |
202 new PackageId( | 202 new PackageId( |
203 'bar', mockSource.name, new Version.parse('3.2.1'), 'bar desc') | 203 'bar', mockSource.name, new Version.parse('3.2.1'), 'bar desc') |
204 ], sources); | 204 ], sources); |
205 | 205 |
206 expect(loadYaml(lockfile.serialize(null, sources)), equals({ | 206 expect(loadYaml(lockfile.serialize(null)), equals({ |
207 'packages': { | 207 'packages': { |
208 'foo': { | 208 'foo': { |
209 'version': '1.2.3', | 209 'version': '1.2.3', |
210 'source': 'mock', | 210 'source': 'mock', |
211 'description': 'foo desc' | 211 'description': 'foo desc' |
212 }, | 212 }, |
213 'bar': { | 213 'bar': { |
214 'version': '3.2.1', | 214 'version': '3.2.1', |
215 'source': 'mock', | 215 'source': 'mock', |
216 'description': 'bar desc' | 216 'description': 'bar desc' |
217 } | 217 } |
218 } | 218 } |
219 })); | 219 })); |
220 }); | 220 }); |
221 }); | 221 }); |
222 } | 222 } |
OLD | NEW |