OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
9 | 9 |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
11 import '../test_pub.dart'; | 11 import '../test_pub.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 initConfig(); | 14 initConfig(); |
15 integration("upgrades a snapshot when a git dependency is upgraded", () { | 15 integration("upgrades a snapshot when a git dependency is upgraded", () { |
16 ensureGit(); | 16 ensureGit(); |
17 | 17 |
18 d.git('foo.git', [ | 18 d.git('foo.git', [d.pubspec({ |
19 d.pubspec({ | |
20 "name": "foo", | 19 "name": "foo", |
21 "version": "0.0.1" | 20 "version": "0.0.1" |
22 }), | 21 }), |
23 d.dir("bin", [ | 22 d.dir( |
24 d.file("hello.dart", "void main() => print('Hello!');") | 23 "bin", |
25 ]) | 24 [d.file("hello.dart", "void main() => print('Hello!');")])]).creat
e(); |
26 ]).create(); | |
27 | 25 |
28 d.appDir({"foo": {"git": "../foo.git"}}).create(); | 26 d.appDir({ |
| 27 "foo": { |
| 28 "git": "../foo.git" |
| 29 } |
| 30 }).create(); |
29 | 31 |
30 pubGet(output: contains("Precompiled foo:hello.")); | 32 pubGet(output: contains("Precompiled foo:hello.")); |
31 | 33 |
32 d.dir(p.join(appPath, '.pub', 'bin', 'foo'), [ | 34 d.dir( |
33 d.matcherFile('hello.dart.snapshot', contains('Hello!')) | 35 p.join(appPath, '.pub', 'bin', 'foo'), |
34 ]).validate(); | 36 [d.matcherFile('hello.dart.snapshot', contains('Hello!'))]).validate(); |
35 | 37 |
36 d.git('foo.git', [ | 38 d.git( |
37 d.dir("bin", [ | 39 'foo.git', |
38 d.file("hello.dart", "void main() => print('Goodbye!');") | 40 [ |
39 ]) | 41 d.dir( |
40 ]).commit(); | 42 "bin", |
| 43 [d.file("hello.dart", "void main() => print('Goodbye!');")])]).c
ommit(); |
41 | 44 |
42 pubUpgrade(output: contains("Precompiled foo:hello.")); | 45 pubUpgrade(output: contains("Precompiled foo:hello.")); |
43 | 46 |
44 d.dir(p.join(appPath, '.pub', 'bin', 'foo'), [ | 47 d.dir( |
45 d.matcherFile('hello.dart.snapshot', contains('Goodbye!')) | 48 p.join(appPath, '.pub', 'bin', 'foo'), |
46 ]).validate(); | 49 [d.matcherFile('hello.dart.snapshot', contains('Goodbye!'))]).validate()
; |
47 | 50 |
48 var process = pubRun(args: ['foo:hello']); | 51 var process = pubRun(args: ['foo:hello']); |
49 process.stdout.expect("Goodbye!"); | 52 process.stdout.expect("Goodbye!"); |
50 process.shouldExit(); | 53 process.shouldExit(); |
51 }); | 54 }); |
52 } | 55 } |
OLD | NEW |