OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 d.file. |
4 | 4 |
5 import '../../../../../pkg/pathos/lib/path.dart' as path; | 5 import '../../../../../pkg/pathos/lib/path.dart' as path; |
6 | 6 |
7 import '../../../../pub/exit_codes.dart' as exit_codes; | 7 import '../../../../pub/exit_codes.dart' as exit_codes; |
| 8 import '../../descriptor.dart' as d; |
8 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
9 | 10 |
10 main() { | 11 main() { |
11 initConfig(); | 12 initConfig(); |
12 integration("can use relative path", () { | 13 integration("can use relative path", () { |
13 dir("foo", [ | 14 d.dir("foo", [ |
14 libDir("foo"), | 15 d.libDir("foo"), |
15 libPubspec("foo", "0.0.1") | 16 d.libPubspec("foo", "0.0.1") |
16 ]).scheduleCreate(); | 17 ]).create(); |
17 | 18 |
18 dir(appPath, [ | 19 d.dir(appPath, [ |
19 pubspec({ | 20 d.pubspec({ |
20 "name": "myapp", | 21 "name": "myapp", |
21 "dependencies": { | 22 "dependencies": { |
22 "foo": {"path": "../foo"} | 23 "foo": {"path": "../foo"} |
23 } | 24 } |
24 }) | 25 }) |
25 ]).scheduleCreate(); | 26 ]).create(); |
26 | 27 |
27 schedulePub(args: ["install"], | 28 schedulePub(args: ["install"], |
28 output: new RegExp(r"Dependencies installed!$")); | 29 output: new RegExp(r"Dependencies installed!$")); |
29 | 30 |
30 dir(packagesPath, [ | 31 d.dir(packagesPath, [ |
31 dir("foo", [ | 32 d.dir("foo", [ |
32 file("foo.dart", 'main() => "foo";') | 33 d.file("foo.dart", 'main() => "foo";') |
33 ]) | 34 ]) |
34 ]).scheduleValidate(); | 35 ]).validate(); |
35 }); | 36 }); |
36 | 37 |
37 integration("path is relative to containing pubspec", () { | 38 integration("path is relative to containing d.pubspec", () { |
38 dir("relative", [ | 39 d.dir("relative", [ |
39 dir("foo", [ | 40 d.dir("foo", [ |
40 libDir("foo"), | 41 d.libDir("foo"), |
41 libPubspec("foo", "0.0.1", deps: [ | 42 d.libPubspec("foo", "0.0.1", deps: [ |
42 {"path": "../bar"} | 43 {"path": "../bar"} |
43 ]) | 44 ]) |
44 ]), | 45 ]), |
45 dir("bar", [ | 46 d.dir("bar", [ |
46 libDir("bar"), | 47 d.libDir("bar"), |
47 libPubspec("bar", "0.0.1") | 48 d.libPubspec("bar", "0.0.1") |
48 ]) | 49 ]) |
49 ]).scheduleCreate(); | 50 ]).create(); |
50 | 51 |
51 dir(appPath, [ | 52 d.dir(appPath, [ |
52 pubspec({ | 53 d.pubspec({ |
53 "name": "myapp", | 54 "name": "myapp", |
54 "dependencies": { | 55 "dependencies": { |
55 "foo": {"path": "../relative/foo"} | 56 "foo": {"path": "../relative/foo"} |
56 } | 57 } |
57 }) | 58 }) |
58 ]).scheduleCreate(); | 59 ]).create(); |
59 | 60 |
60 schedulePub(args: ["install"], | 61 schedulePub(args: ["install"], |
61 output: new RegExp(r"Dependencies installed!$")); | 62 output: new RegExp(r"Dependencies installed!$")); |
62 | 63 |
63 dir(packagesPath, [ | 64 d.dir(packagesPath, [ |
64 dir("foo", [ | 65 d.dir("foo", [ |
65 file("foo.dart", 'main() => "foo";') | 66 d.file("foo.dart", 'main() => "foo";') |
66 ]), | 67 ]), |
67 dir("bar", [ | 68 d.dir("bar", [ |
68 file("bar.dart", 'main() => "bar";') | 69 d.file("bar.dart", 'main() => "bar";') |
69 ]) | 70 ]) |
70 ]).scheduleValidate(); | 71 ]).validate(); |
71 }); | 72 }); |
72 } | 73 } |
OLD | NEW |