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

Side by Side Diff: sdk/lib/_internal/pub/test/unknown_source_test.dart

Issue 16034002: Use helper methods for running pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Get rid of unnecessary RegExps in tests. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.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 d.file. 3 // BSD-style license that can be found in the LICENSE d.file.
4 4
5 library pub_tests; 5 library pub_tests;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:json' as json; 8 import 'dart:json' as json;
9 9
10 import 'descriptor.dart' as d; 10 import 'descriptor.dart' as d;
11 import 'test_pub.dart'; 11 import 'test_pub.dart';
12 12
13 main() { 13 main() {
14 initConfig(); 14 initConfig();
15 15
16 forBothPubInstallAndUpdate((command) { 16 forBothPubInstallAndUpdate((command) {
17 integration('fails gracefully on a dependency from an unknown source', () { 17 integration('fails gracefully on a dependency from an unknown source', () {
18 d.appDir([{"bad": "foo"}]).create(); 18 d.appDir([{"bad": "foo"}]).create();
19 19
20 pubCommand(command, error: new RegExp( 20 pubCommand(command, error:
21 "Package 'myapp' depends on 'foo' from unknown source 'bad'.\$")); 21 "Package 'myapp' depends on 'foo' from unknown source 'bad'.");
22 }); 22 });
23 23
24 integration('fails gracefully on transitive dependency from an unknown ' 24 integration('fails gracefully on transitive dependency from an unknown '
25 'source', () { 25 'source', () {
26 d.dir('foo', [ 26 d.dir('foo', [
27 d.libDir('foo', 'foo 0.0.1'), 27 d.libDir('foo', 'foo 0.0.1'),
28 d.libPubspec('foo', '0.0.1', deps: [{"bad": "bar"}]) 28 d.libPubspec('foo', '0.0.1', deps: [{"bad": "bar"}])
29 ]).create(); 29 ]).create();
30 30
31 d.appDir([{"path": "../foo"}]).create(); 31 d.appDir([{"path": "../foo"}]).create();
32 32
33 pubCommand(command, error: new RegExp( 33 pubCommand(command, error:
34 "Package 'foo' depends on 'bar' from unknown source 'bad'.\$")); 34 "Package 'foo' depends on 'bar' from unknown source 'bad'.");
35 }); 35 });
36 36
37 integration('ignores unknown source in lockfile', () { 37 integration('ignores unknown source in lockfile', () {
38 d.dir('foo', [ 38 d.dir('foo', [
39 d.libDir('foo'), 39 d.libDir('foo'),
40 d.libPubspec('foo', '0.0.1') 40 d.libPubspec('foo', '0.0.1')
41 ]).create(); 41 ]).create();
42 42
43 // Depend on "foo" from a valid source. 43 // Depend on "foo" from a valid source.
44 d.dir(appPath, [ 44 d.dir(appPath, [
(...skipping 24 matching lines...) Expand all
69 69
70 // Should update to the new one. 70 // Should update to the new one.
71 d.dir(packagesPath, [ 71 d.dir(packagesPath, [
72 d.dir("foo", [ 72 d.dir("foo", [
73 d.file("foo.dart", 'main() => "foo";') 73 d.file("foo.dart", 'main() => "foo";')
74 ]) 74 ])
75 ]).validate(); 75 ]).validate();
76 }); 76 });
77 }); 77 });
78 } 78 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/test/test_pub.dart ('k') | sdk/lib/_internal/pub/test/update/git/do_not_update_if_unneeded_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698