OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, 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 'package:scheduled_test/scheduled_test.dart'; | |
6 | |
7 import 'descriptor.dart' as d; | |
8 import 'test_pub.dart'; | |
9 | |
10 main() { | |
11 initConfig(); | |
12 | |
13 forBothPubGetAndUpgrade((command) { | |
14 group("with --no-package-symlinks", () { | |
15 integration("installs hosted dependencies to the cache", () { | |
16 servePackages((builder) { | |
17 builder.serve("foo", "1.0.0"); | |
18 builder.serve("bar", "1.0.0"); | |
19 }); | |
20 | |
21 d.appDir({"foo": "any", "bar": "any"}).create(); | |
22 | |
23 pubCommand(command, args: ["--no-package-symlinks"]); | |
24 | |
25 d.nothing("$appPath/packages").validate(); | |
26 | |
27 d.hostedCache([ | |
28 d.dir("foo-1.0.0", [ | |
29 d.dir("lib", [d.file("foo.dart", 'main() => "foo 1.0.0";')]) | |
30 ]), | |
31 d.dir("bar-1.0.0", [ | |
32 d.dir("lib", [d.file("bar.dart", 'main() => "bar 1.0.0";')]) | |
33 ]) | |
34 ]).validate(); | |
35 }); | |
36 | |
37 integration("installs git dependencies to the cache", () { | |
38 ensureGit(); | |
39 | |
40 d.git('foo.git', [ | |
41 d.libDir('foo'), | |
42 d.libPubspec('foo', '1.0.0') | |
43 ]).create(); | |
44 | |
45 d.appDir({"foo": {"git": "../foo.git"}}).create(); | |
46 | |
47 pubCommand(command, args: ["--no-package-symlinks"]); | |
48 | |
49 d.nothing("$appPath/packages").validate(); | |
50 | |
51 d.dir(cachePath, [ | |
52 d.dir('git', [ | |
53 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), | |
54 d.gitPackageRevisionCacheDir('foo') | |
55 ]) | |
56 ]).validate(); | |
57 }); | |
58 | |
59 integration("locks path dependencies", () { | |
60 d.dir("foo", [ | |
61 d.libDir("foo"), | |
62 d.libPubspec("foo", "0.0.1") | |
63 ]).create(); | |
64 | |
65 d.dir(appPath, [ | |
66 d.appPubspec({ | |
67 "foo": {"path": "../foo"} | |
68 }) | |
69 ]).create(); | |
70 | |
71 pubCommand(command, args: ["--no-package-symlinks"]); | |
72 | |
73 d.nothing("$appPath/packages").validate(); | |
74 d.matcherFile("$appPath/pubspec.lock", contains("foo")); | |
75 }); | |
76 | |
77 integration("removes package directories near entrypoints", () { | |
78 d.dir(appPath, [ | |
79 d.appPubspec(), | |
80 d.dir("packages"), | |
81 d.dir("bin/packages"), | |
82 d.dir("web/packages"), | |
83 d.dir("web/subdir/packages") | |
84 ]).create(); | |
85 | |
86 pubCommand(command, args: ["--no-package-symlinks"]); | |
87 | |
88 d.dir(appPath, [ | |
89 d.nothing("packages"), | |
90 d.nothing("bin/packages"), | |
91 d.nothing("web/packages"), | |
92 d.nothing("web/subdir/packages") | |
93 ]).validate(); | |
94 }); | |
95 | |
96 integration("doesn't remove package directories that pub wouldn't " | |
97 "generate", () { | |
98 d.dir(appPath, [ | |
99 d.appPubspec(), | |
100 d.dir("packages"), | |
101 d.dir("bin/subdir/packages"), | |
102 d.dir("lib/packages") | |
103 ]).create(); | |
104 | |
105 pubCommand(command, args: ["--no-package-symlinks"]); | |
106 | |
107 d.dir(appPath, [ | |
108 d.nothing("packages"), | |
109 d.dir("bin/subdir/packages"), | |
110 d.dir("lib/packages") | |
111 ]).validate(); | |
112 }); | |
113 }); | |
114 }); | |
115 } | |
OLD | NEW |