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

Side by Side Diff: test/hosted/offline_test.dart

Issue 1971523002: Fix --offline with prerelease versions. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « lib/src/source/hosted.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) 2012, the Dart project authors. Please see the AUTHORS file 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 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:pub/src/exit_codes.dart' as exit_codes; 5 import 'package:pub/src/exit_codes.dart' as exit_codes;
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() {
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 pubCommand(command, args: ['--offline'], warning: warning); 32 pubCommand(command, args: ['--offline'], warning: warning);
33 33
34 d.packagesDir({ 34 d.packagesDir({
35 "foo": "1.2.3", 35 "foo": "1.2.3",
36 "bar": "1.2.3" 36 "bar": "1.2.3"
37 }).validate(); 37 }).validate();
38 }); 38 });
39 39
40 integration('supports prerelease versions', () {
41 // Run the server so that we know what URL to use in the system cache.
42 serveErrors();
43
44 d.cacheDir({
45 "foo": ["1.2.3-alpha.1"]
46 }, includePubspecs: true).create();
47
48 d.appDir({
49 "foo": "any"
50 }).create();
51
52 var warning = null;
53 if (command == RunCommand.upgrade) {
54 warning = "Warning: Upgrading when offline may not update you "
55 "to the latest versions of your dependencies.";
56 }
57
58 pubCommand(command, args: ['--offline'], warning: warning);
59
60 d.packagesDir({
61 "foo": "1.2.3-alpha.1"
62 }).validate();
63 });
64
40 integration('fails gracefully if a dependency is not cached', () { 65 integration('fails gracefully if a dependency is not cached', () {
41 // Run the server so that we know what URL to use in the system cache. 66 // Run the server so that we know what URL to use in the system cache.
42 serveErrors(); 67 serveErrors();
43 68
44 d.appDir({"foo": "any"}).create(); 69 d.appDir({"foo": "any"}).create();
45 70
46 pubCommand(command, args: ['--offline'], 71 pubCommand(command, args: ['--offline'],
47 exitCode: exit_codes.UNAVAILABLE, 72 exitCode: exit_codes.UNAVAILABLE,
48 error: "Could not find package foo in cache.\n" 73 error: "Could not find package foo in cache.\n"
49 "Depended on by:\n" 74 "Depended on by:\n"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 d.appDir({"foo": "any"}).create(); 117 d.appDir({"foo": "any"}).create();
93 118
94 createLockFile('myapp', hosted: {'foo': '1.2.4'}); 119 createLockFile('myapp', hosted: {'foo': '1.2.4'});
95 120
96 pubCommand(command, args: ['--offline']); 121 pubCommand(command, args: ['--offline']);
97 122
98 d.packagesDir({"foo": "1.2.3"}).validate(); 123 d.packagesDir({"foo": "1.2.3"}).validate();
99 }); 124 });
100 }); 125 });
101 } 126 }
OLDNEW
« no previous file with comments | « lib/src/source/hosted.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698