| 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 pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
| 8 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| 11 initConfig(); | 11 initConfig(); |
| 12 integration('checks out a package at a specific revision from Git', () { | 12 integration('checks out a package at a specific revision from Git', () { |
| 13 ensureGit(); | 13 ensureGit(); |
| 14 | 14 |
| 15 var repo = d.git('foo.git', [ | 15 var repo = |
| 16 d.libDir('foo', 'foo 1'), | 16 d.git('foo.git', [d.libDir('foo', 'foo 1'), d.libPubspec('foo', '1.0.0')
]); |
| 17 d.libPubspec('foo', '1.0.0') | |
| 18 ]); | |
| 19 repo.create(); | 17 repo.create(); |
| 20 var commit = repo.revParse('HEAD'); | 18 var commit = repo.revParse('HEAD'); |
| 21 | 19 |
| 22 d.git('foo.git', [ | 20 d.git( |
| 23 d.libDir('foo', 'foo 2'), | 21 'foo.git', |
| 24 d.libPubspec('foo', '1.0.0') | 22 [d.libDir('foo', 'foo 2'), d.libPubspec('foo', '1.0.0')]).commit(); |
| 25 ]).commit(); | |
| 26 | 23 |
| 27 d.appDir({ | 24 d.appDir({ |
| 28 "foo": {"git": {"url": "../foo.git", "ref": commit}} | 25 "foo": { |
| 26 "git": { |
| 27 "url": "../foo.git", |
| 28 "ref": commit |
| 29 } |
| 30 } |
| 29 }).create(); | 31 }).create(); |
| 30 | 32 |
| 31 pubGet(); | 33 pubGet(); |
| 32 | 34 |
| 33 d.dir(packagesPath, [ | 35 d.dir( |
| 34 d.dir('foo', [ | 36 packagesPath, |
| 35 d.file('foo.dart', 'main() => "foo 1";') | 37 [d.dir('foo', [d.file('foo.dart', 'main() => "foo 1";')])]).validate(); |
| 36 ]) | |
| 37 ]).validate(); | |
| 38 }); | 38 }); |
| 39 } | 39 } |
| OLD | NEW |