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