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