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

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

Powered by Google App Engine
This is Rietveld 408576698