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