OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library pub_tests; |
| 6 |
| 7 import '../../../../../pkg/path/lib/path.dart' as path; |
| 8 |
| 9 import '../../../../pub/io.dart'; |
| 10 import '../../test_pub.dart'; |
| 11 |
| 12 main() { |
| 13 initConfig(); |
| 14 integration('re-installs a package if it has an empty "lib" directory', () { |
| 15 |
| 16 servePackages([package("foo", "1.2.3")]); |
| 17 |
| 18 // Set up a cache with a broken foo package. |
| 19 dir(cachePath, [ |
| 20 dir('hosted', [ |
| 21 async(port.then((p) => dir('localhost%58$p', [ |
| 22 dir("foo-1.2.3", [ |
| 23 libPubspec("foo", "1.2.3"), |
| 24 // Note: empty "lib" directory. |
| 25 dir("lib", []) |
| 26 ]) |
| 27 ]))) |
| 28 ]) |
| 29 ]).scheduleCreate(); |
| 30 |
| 31 appDir([dependency("foo", "1.2.3")]).scheduleCreate(); |
| 32 |
| 33 schedulePub(args: ['install'], |
| 34 output: new RegExp("Dependencies installed!\$")); |
| 35 |
| 36 cacheDir({"foo": "1.2.3"}).scheduleValidate(); |
| 37 packagesDir({"foo": "1.2.3"}).scheduleValidate(); |
| 38 }); |
| 39 |
| 40 integration('re-installs a package if it has no pubspec', () { |
| 41 |
| 42 servePackages([package("foo", "1.2.3")]); |
| 43 |
| 44 // Set up a cache with a broken foo package. |
| 45 dir(cachePath, [ |
| 46 dir('hosted', [ |
| 47 async(port.then((p) => dir('localhost%58$p', [ |
| 48 dir("foo-1.2.3", [ |
| 49 libDir("foo") |
| 50 // Note: no pubspec. |
| 51 ]) |
| 52 ]))) |
| 53 ]) |
| 54 ]).scheduleCreate(); |
| 55 |
| 56 appDir([dependency("foo", "1.2.3")]).scheduleCreate(); |
| 57 |
| 58 schedulePub(args: ['install'], |
| 59 output: new RegExp("Dependencies installed!\$")); |
| 60 |
| 61 cacheDir({"foo": "1.2.3"}).scheduleValidate(); |
| 62 packagesDir({"foo": "1.2.3"}).scheduleValidate(); |
| 63 }); |
| 64 } |
OLD | NEW |