OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'descriptor.dart' as d; |
| 6 import 'test_pub.dart'; |
| 7 import '../lib/src/barback.dart' as barback; |
| 8 import '../lib/src/version.dart'; |
| 9 |
| 10 main() { |
| 11 initConfig(); |
| 12 |
| 13 var previousVersion = new Version( |
| 14 barback.supportedVersion.major, barback.supportedVersion.minor - 1, 0); |
| 15 |
| 16 forBothPubGetAndUpgrade((command) { |
| 17 integration("implicitly constrains barback to versions pub supports", () { |
| 18 servePackages([ |
| 19 packageMap("barback", previousVersion.toString()), |
| 20 packageMap("barback", barback.supportedVersion.toString()), |
| 21 packageMap("barback", barback.supportedVersion.nextPatch.toString()), |
| 22 packageMap("barback", barback.supportedVersion.nextMinor.toString()) |
| 23 ]); |
| 24 |
| 25 d.appDir({ |
| 26 "barback": "any" |
| 27 }).create(); |
| 28 |
| 29 pubCommand(command); |
| 30 |
| 31 d.packagesDir({ |
| 32 "barback": barback.supportedVersion.nextPatch.toString() |
| 33 }).validate(); |
| 34 }); |
| 35 |
| 36 integration("discovers transitive dependency on barback", () { |
| 37 servePackages([ |
| 38 packageMap("barback", previousVersion.toString()), |
| 39 packageMap("barback", barback.supportedVersion.toString()), |
| 40 packageMap("barback", barback.supportedVersion.nextPatch.toString()), |
| 41 packageMap("barback", barback.supportedVersion.nextMinor.toString()) |
| 42 ]); |
| 43 |
| 44 d.dir("foo", [ |
| 45 d.libDir("foo", "foo 0.0.1"), |
| 46 d.libPubspec("foo", "0.0.1", deps: { |
| 47 "barback": "any" |
| 48 }) |
| 49 ]).create(); |
| 50 |
| 51 d.appDir({ |
| 52 "foo": {"path": "../foo"} |
| 53 }).create(); |
| 54 |
| 55 pubCommand(command); |
| 56 |
| 57 d.packagesDir({ |
| 58 "barback": barback.supportedVersion.nextPatch.toString(), |
| 59 "foo": "0.0.1" |
| 60 }).validate(); |
| 61 }); |
| 62 }); |
| 63 |
| 64 integration("unlock if the locked version doesn't meet pub's constraint", () { |
| 65 servePackages([ |
| 66 packageMap("barback", previousVersion.toString()), |
| 67 packageMap("barback", barback.supportedVersion.toString()) |
| 68 ]); |
| 69 |
| 70 d.appDir({"barback": "any"}).create(); |
| 71 |
| 72 // Hand-create a lockfile to pin barback to an older version. |
| 73 createLockFile("myapp", hosted: { |
| 74 "barback": previousVersion.toString() |
| 75 }); |
| 76 |
| 77 pubGet(); |
| 78 |
| 79 // It should be upgraded. |
| 80 d.packagesDir({ |
| 81 "barback": barback.supportedVersion.toString() |
| 82 }).validate(); |
| 83 }); |
| 84 } |
OLD | NEW |