Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: test/no_packages_dir_test.dart

Issue 2250643003: Add a --[no]-packages-dir flag. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« lib/src/entrypoint.dart ('K') | « test/no_package_symlinks_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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 import 'package:scheduled_test/scheduled_test.dart'; 5 import 'package:scheduled_test/scheduled_test.dart';
6 6
7 import 'descriptor.dart' as d; 7 import 'descriptor.dart' as d;
8 import 'test_pub.dart'; 8 import 'test_pub.dart';
9 9
10 main() { 10 main() {
11 forBothPubGetAndUpgrade((command) { 11 forBothPubGetAndUpgrade((command) {
12 group("with --no-package-symlinks", () { 12 group("with --no-packages-dir", () {
13 integration("installs hosted dependencies to the cache", () { 13 integration("installs hosted dependencies to the cache", () {
14 servePackages((builder) { 14 servePackages((builder) {
15 builder.serve("foo", "1.0.0"); 15 builder.serve("foo", "1.0.0");
16 builder.serve("bar", "1.0.0"); 16 builder.serve("bar", "1.0.0");
17 }); 17 });
18 18
19 d.appDir({"foo": "any", "bar": "any"}).create(); 19 d.appDir({"foo": "any", "bar": "any"}).create();
20 20
21 pubCommand(command, args: ["--no-package-symlinks"]); 21 pubCommand(command, args: ["--no-packages-dir"]);
22 22
23 d.nothing("$appPath/packages").validate(); 23 d.nothing("$appPath/packages").validate();
24 24
25 d.hostedCache([ 25 d.hostedCache([
26 d.dir("foo-1.0.0", [ 26 d.dir("foo-1.0.0", [
27 d.dir("lib", [d.file("foo.dart", 'main() => "foo 1.0.0";')]) 27 d.dir("lib", [d.file("foo.dart", 'main() => "foo 1.0.0";')])
28 ]), 28 ]),
29 d.dir("bar-1.0.0", [ 29 d.dir("bar-1.0.0", [
30 d.dir("lib", [d.file("bar.dart", 'main() => "bar 1.0.0";')]) 30 d.dir("lib", [d.file("bar.dart", 'main() => "bar 1.0.0";')])
31 ]) 31 ])
32 ]).validate(); 32 ]).validate();
33 }); 33 });
34 34
35 integration("installs git dependencies to the cache", () { 35 integration("installs git dependencies to the cache", () {
36 ensureGit(); 36 ensureGit();
37 37
38 d.git('foo.git', [ 38 d.git('foo.git', [
39 d.libDir('foo'), 39 d.libDir('foo'),
40 d.libPubspec('foo', '1.0.0') 40 d.libPubspec('foo', '1.0.0')
41 ]).create(); 41 ]).create();
42 42
43 d.appDir({"foo": {"git": "../foo.git"}}).create(); 43 d.appDir({"foo": {"git": "../foo.git"}}).create();
44 44
45 pubCommand(command, args: ["--no-package-symlinks"]); 45 pubCommand(command, args: ["--no-packages-dir"]);
46 46
47 d.nothing("$appPath/packages").validate(); 47 d.nothing("$appPath/packages").validate();
48 48
49 d.dir(cachePath, [ 49 d.dir(cachePath, [
50 d.dir('git', [ 50 d.dir('git', [
51 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]), 51 d.dir('cache', [d.gitPackageRepoCacheDir('foo')]),
52 d.gitPackageRevisionCacheDir('foo') 52 d.gitPackageRevisionCacheDir('foo')
53 ]) 53 ])
54 ]).validate(); 54 ]).validate();
55 }); 55 });
56 56
57 integration("locks path dependencies", () { 57 integration("locks path dependencies", () {
58 d.dir("foo", [ 58 d.dir("foo", [
59 d.libDir("foo"), 59 d.libDir("foo"),
60 d.libPubspec("foo", "0.0.1") 60 d.libPubspec("foo", "0.0.1")
61 ]).create(); 61 ]).create();
62 62
63 d.dir(appPath, [ 63 d.dir(appPath, [
64 d.appPubspec({ 64 d.appPubspec({
65 "foo": {"path": "../foo"} 65 "foo": {"path": "../foo"}
66 }) 66 })
67 ]).create(); 67 ]).create();
68 68
69 pubCommand(command, args: ["--no-package-symlinks"]); 69 pubCommand(command, args: ["--no-packages-dir"]);
70 70
71 d.nothing("$appPath/packages").validate(); 71 d.nothing("$appPath/packages").validate();
72 d.matcherFile("$appPath/pubspec.lock", contains("foo")); 72 d.matcherFile("$appPath/pubspec.lock", contains("foo"));
73 }); 73 });
74 74
75 integration("removes package directories near entrypoints", () { 75 integration("removes package directories near entrypoints", () {
76 d.dir(appPath, [ 76 d.dir(appPath, [
77 d.appPubspec(), 77 d.appPubspec(),
78 d.dir("packages"), 78 d.dir("packages"),
79 d.dir("bin/packages"), 79 d.dir("bin/packages"),
80 d.dir("web/packages"), 80 d.dir("web/packages"),
81 d.dir("web/subdir/packages") 81 d.dir("web/subdir/packages")
82 ]).create(); 82 ]).create();
83 83
84 pubCommand(command, args: ["--no-package-symlinks"]); 84 pubCommand(command, args: ["--no-packages-dir"]);
85 85
86 d.dir(appPath, [ 86 d.dir(appPath, [
87 d.nothing("packages"), 87 d.nothing("packages"),
88 d.nothing("bin/packages"), 88 d.nothing("bin/packages"),
89 d.nothing("web/packages"), 89 d.nothing("web/packages"),
90 d.nothing("web/subdir/packages") 90 d.nothing("web/subdir/packages")
91 ]).validate(); 91 ]).validate();
92 }); 92 });
93 93
94 integration("doesn't remove package directories that pub wouldn't " 94 integration("doesn't remove package directories that pub wouldn't "
95 "generate", () { 95 "generate", () {
96 d.dir(appPath, [ 96 d.dir(appPath, [
97 d.appPubspec(), 97 d.appPubspec(),
98 d.dir("packages"), 98 d.dir("packages"),
99 d.dir("bin/subdir/packages"), 99 d.dir("bin/subdir/packages"),
100 d.dir("lib/packages") 100 d.dir("lib/packages")
101 ]).create(); 101 ]).create();
102 102
103 pubCommand(command, args: ["--no-package-symlinks"]); 103 pubCommand(command, args: ["--no-packages-dir"]);
104 104
105 d.dir(appPath, [ 105 d.dir(appPath, [
106 d.nothing("packages"), 106 d.nothing("packages"),
107 d.dir("bin/subdir/packages"), 107 d.dir("bin/subdir/packages"),
108 d.dir("lib/packages") 108 d.dir("lib/packages")
109 ]).validate(); 109 ]).validate();
110 }); 110 });
111 }); 111 });
112 }); 112 });
113 } 113 }
OLDNEW
« lib/src/entrypoint.dart ('K') | « test/no_package_symlinks_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698