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