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