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