| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
| 9 | 9 |
| 10 main() { | 10 main() { |
| 11 initConfig(); | 11 initConfig(); |
| 12 integration("downgrades a locked package's dependers in order to get it to " | 12 integration("downgrades a locked package's dependers in order to get it to " |
| 13 "min version", () { | 13 "min version", () { |
| 14 servePackages([ | 14 servePackages((builder) { |
| 15 packageMap("foo", "2.0.0", {"bar": ">1.0.0"}), | 15 builder.serve("foo", "2.0.0", pubspec: { |
| 16 packageMap("bar", "2.0.0") | 16 "dependencies": {"bar": ">1.0.0"} |
| 17 ]); | 17 }); |
| 18 builder.serve("bar", "2.0.0"); |
| 19 }); |
| 18 | 20 |
| 19 d.appDir({"foo": "any", "bar": "any"}).create(); | 21 d.appDir({"foo": "any", "bar": "any"}).create(); |
| 20 | 22 |
| 21 pubGet(); | 23 pubGet(); |
| 22 | 24 |
| 23 d.packagesDir({ | 25 d.packagesDir({ |
| 24 "foo": "2.0.0", | 26 "foo": "2.0.0", |
| 25 "bar": "2.0.0" | 27 "bar": "2.0.0" |
| 26 }).validate(); | 28 }).validate(); |
| 27 | 29 |
| 28 servePackages([ | 30 servePackages((builder) { |
| 29 packageMap("foo", "1.0.0", {"bar": "any"}), | 31 builder.serve("foo", "1.0.0", pubspec: { |
| 30 packageMap("bar", "1.0.0") | 32 "dependencies": {"bar": "any"} |
| 31 ]); | 33 }); |
| 34 builder.serve("bar", "1.0.0"); |
| 35 }); |
| 32 | 36 |
| 33 pubDowngrade(args: ['bar']); | 37 pubDowngrade(args: ['bar']); |
| 34 | 38 |
| 35 d.packagesDir({ | 39 d.packagesDir({ |
| 36 "foo": "1.0.0", | 40 "foo": "1.0.0", |
| 37 "bar": "1.0.0" | 41 "bar": "1.0.0" |
| 38 }).validate(); | 42 }).validate(); |
| 39 }); | 43 }); |
| 40 } | 44 } |
| OLD | NEW |