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 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 import '../../../pkg/pathos/lib/path.dart' as path; | 5 import '../../../pkg/pathos/lib/path.dart' as path; |
6 | 6 |
| 7 import 'descriptor.dart' as d; |
7 import 'test_pub.dart'; | 8 import 'test_pub.dart'; |
8 | 9 |
9 main() { | 10 main() { |
10 initConfig(); | 11 initConfig(); |
11 integration("includes root package's dev dependencies", () { | 12 integration("includes root package's dev dependencies", () { |
12 dir('foo', [ | 13 d.dir('foo', [ |
13 libDir('foo'), | 14 d.libDir('foo'), |
14 libPubspec('foo', '0.0.1') | 15 d.libPubspec('foo', '0.0.1') |
15 ]).scheduleCreate(); | 16 ]).create(); |
16 | 17 |
17 dir('bar', [ | 18 d.dir('bar', [ |
18 libDir('bar'), | 19 d.libDir('bar'), |
19 libPubspec('bar', '0.0.1') | 20 d.libPubspec('bar', '0.0.1') |
20 ]).scheduleCreate(); | 21 ]).create(); |
21 | 22 |
22 dir(appPath, [ | 23 d.dir(appPath, [ |
23 pubspec({ | 24 d.pubspec({ |
24 "name": "myapp", | 25 "name": "myapp", |
25 "dev_dependencies": { | 26 "dev_dependencies": { |
26 "foo": {"path": "../foo"}, | 27 "foo": {"path": "../foo"}, |
27 "bar": {"path": "../bar"}, | 28 "bar": {"path": "../bar"}, |
28 } | 29 } |
29 }) | 30 }) |
30 ]).scheduleCreate(); | 31 ]).create(); |
31 | 32 |
32 schedulePub(args: ["install"], | 33 schedulePub(args: ["install"], |
33 output: new RegExp(r"Dependencies installed!$")); | 34 output: new RegExp(r"Dependencies installed!$")); |
34 | 35 |
35 dir(packagesPath, [ | 36 d.dir(packagesPath, [ |
36 dir("foo", [ | 37 d.dir("foo", [ |
37 file("foo.dart", 'main() => "foo";') | 38 d.file("foo.dart", 'main() => "foo";') |
38 ]), | 39 ]), |
39 dir("bar", [ | 40 d.dir("bar", [ |
40 file("bar.dart", 'main() => "bar";') | 41 d.file("bar.dart", 'main() => "bar";') |
41 ]) | 42 ]) |
42 ]).scheduleValidate(); | 43 ]).validate(); |
43 }); | 44 }); |
44 | 45 |
45 integration("includes dev dependency's transitive dependencies", () { | 46 integration("includes dev dependency's transitive dependencies", () { |
46 dir('foo', [ | 47 d.dir('foo', [ |
47 libDir('foo'), | 48 d.libDir('foo'), |
48 libPubspec('foo', '0.0.1', deps: [ | 49 d.libPubspec('foo', '0.0.1', deps: [ |
49 {"path": "../bar"} | 50 {"path": "../bar"} |
50 ]) | 51 ]) |
51 ]).scheduleCreate(); | 52 ]).create(); |
52 | 53 |
53 dir('bar', [ | 54 d.dir('bar', [ |
54 libDir('bar'), | 55 d.libDir('bar'), |
55 libPubspec('bar', '0.0.1') | 56 d.libPubspec('bar', '0.0.1') |
56 ]).scheduleCreate(); | 57 ]).create(); |
57 | 58 |
58 dir(appPath, [ | 59 d.dir(appPath, [ |
59 pubspec({ | 60 d.pubspec({ |
60 "name": "myapp", | 61 "name": "myapp", |
61 "dev_dependencies": { | 62 "dev_dependencies": { |
62 "foo": {"path": "../foo"} | 63 "foo": {"path": "../foo"} |
63 } | 64 } |
64 }) | 65 }) |
65 ]).scheduleCreate(); | 66 ]).create(); |
66 | 67 |
67 schedulePub(args: ["install"], | 68 schedulePub(args: ["install"], |
68 output: new RegExp(r"Dependencies installed!$")); | 69 output: new RegExp(r"Dependencies installed!$")); |
69 | 70 |
70 dir(packagesPath, [ | 71 d.dir(packagesPath, [ |
71 dir("foo", [ | 72 d.dir("foo", [ |
72 file("foo.dart", 'main() => "foo";') | 73 d.file("foo.dart", 'main() => "foo";') |
73 ]), | 74 ]), |
74 dir("bar", [ | 75 d.dir("bar", [ |
75 file("bar.dart", 'main() => "bar";') | 76 d.file("bar.dart", 'main() => "bar";') |
76 ]) | 77 ]) |
77 ]).scheduleValidate(); | 78 ]).validate(); |
78 }); | 79 }); |
79 | 80 |
80 integration("ignores transitive dependency's dev dependencies", () { | 81 integration("ignores transitive dependency's dev dependencies", () { |
81 dir('foo', [ | 82 d.dir('foo', [ |
82 libDir('foo'), | 83 d.libDir('foo'), |
83 pubspec({ | 84 d.pubspec({ |
84 "name": "foo", | 85 "name": "foo", |
85 "version": "0.0.1", | 86 "version": "0.0.1", |
86 "dev_dependencies": { | 87 "dev_dependencies": { |
87 "bar": {"path": "../bar"} | 88 "bar": {"path": "../bar"} |
88 } | 89 } |
89 }) | 90 }) |
90 ]).scheduleCreate(); | 91 ]).create(); |
91 | 92 |
92 dir('bar', [ | 93 d.dir('bar', [ |
93 libDir('bar'), | 94 d.libDir('bar'), |
94 libPubspec('bar', '0.0.1') | 95 d.libPubspec('bar', '0.0.1') |
95 ]).scheduleCreate(); | 96 ]).create(); |
96 | 97 |
97 dir(appPath, [ | 98 d.dir(appPath, [ |
98 pubspec({ | 99 d.pubspec({ |
99 "name": "myapp", | 100 "name": "myapp", |
100 "dependencies": { | 101 "dependencies": { |
101 "foo": {"path": "../foo"} | 102 "foo": {"path": "../foo"} |
102 } | 103 } |
103 }) | 104 }) |
104 ]).scheduleCreate(); | 105 ]).create(); |
105 | 106 |
106 schedulePub(args: ["install"], | 107 schedulePub(args: ["install"], |
107 output: new RegExp(r"Dependencies installed!$")); | 108 output: new RegExp(r"Dependencies installed!$")); |
108 | 109 |
109 dir(packagesPath, [ | 110 d.dir(packagesPath, [ |
110 dir("foo", [ | 111 d.dir("foo", [ |
111 file("foo.dart", 'main() => "foo";') | 112 d.file("foo.dart", 'main() => "foo";') |
112 ]), | 113 ]), |
113 nothing("bar") | 114 d.nothing("bar") |
114 ]).scheduleValidate(); | 115 ]).validate(); |
115 }); | 116 }); |
116 } | 117 } |
OLD | NEW |