| 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 'package:path/path.dart' as path; |
| 6 |
| 5 import 'descriptor.dart' as d; | 7 import 'descriptor.dart' as d; |
| 6 import 'test_pub.dart'; | 8 import 'test_pub.dart'; |
| 7 | 9 |
| 8 main() { | 10 main() { |
| 9 initConfig(); | 11 initConfig(); |
| 10 forBothPubGetAndUpgrade((command) { | 12 forBothPubGetAndUpgrade((command) { |
| 11 integration("chooses best version matching override constraint", () { | 13 integration("chooses best version matching override constraint", () { |
| 12 servePackages([ | 14 servePackages([ |
| 13 packageMap("foo", "1.0.0"), | 15 packageMap("foo", "1.0.0"), |
| 14 packageMap("foo", "2.0.0"), | 16 packageMap("foo", "2.0.0"), |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 81 |
| 80 d.packagesDir({ | 82 d.packagesDir({ |
| 81 "foo": "2.0.0", | 83 "foo": "2.0.0", |
| 82 "bar": "1.0.0" | 84 "bar": "1.0.0" |
| 83 }).validate(); | 85 }).validate(); |
| 84 }); | 86 }); |
| 85 | 87 |
| 86 integration("warns about overridden dependencies", () { | 88 integration("warns about overridden dependencies", () { |
| 87 servePackages([ | 89 servePackages([ |
| 88 packageMap("foo", "1.0.0"), | 90 packageMap("foo", "1.0.0"), |
| 89 packageMap("bar", "1.0.0"), | 91 packageMap("bar", "1.0.0") |
| 90 packageMap("baz", "1.0.0") | |
| 91 ]); | 92 ]); |
| 92 | 93 |
| 94 d.dir("baz", [ |
| 95 d.libDir("baz"), |
| 96 d.libPubspec("baz", "0.0.1") |
| 97 ]).create(); |
| 98 |
| 93 d.dir(appPath, [ | 99 d.dir(appPath, [ |
| 94 d.pubspec({ | 100 d.pubspec({ |
| 95 "name": "myapp", | 101 "name": "myapp", |
| 96 "dependency_overrides": { | 102 "dependency_overrides": { |
| 97 "foo": "any", | 103 "foo": "any", |
| 98 "bar": "any", | 104 "bar": "any", |
| 99 "baz": "any" | 105 "baz": {"path": "../baz"} |
| 100 } | 106 } |
| 101 }) | 107 }) |
| 102 ]).create(); | 108 ]).create(); |
| 103 | 109 |
| 110 var bazPath = path.join("..", "baz"); |
| 111 |
| 104 schedulePub(args: [command.name], output: command.success, error: | 112 schedulePub(args: [command.name], output: command.success, error: |
| 105 """ | 113 """ |
| 106 Warning: You are overriding these dependencies: | 114 Warning: You are using these overridden dependencies: |
| 107 - bar any from hosted (bar) | 115 - bar |
| 108 - baz any from hosted (baz) | 116 - baz (from path $bazPath) |
| 109 - foo any from hosted (foo) | 117 - foo |
| 110 """); | 118 """); |
| 111 }); | 119 }); |
| 112 }); | 120 }); |
| 113 } | 121 } |
| OLD | NEW |