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

Side by Side Diff: utils/tests/pub/pub_cache_test.dart

Issue 12755024: add cache list command to pub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « utils/pub/source.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 library pub_cache_test;
6
7 import 'dart:io';
8 import 'dart:json' as json;
9 import 'test_pub.dart';
10 import '../../pub/io.dart';
11
12 main() {
13 initConfig();
14
15 integration('running pub cache displays error message', () {
16 schedulePub(args: ['cache'],
17 output: '''
18 Inspect the system cache.
19
20 Usage: pub cache list
21 ''',
22 error: 'The cache command expects one argument.',
23 exitCode: 64);
24 });
25
26 integration('running pub cache foo displays error message', () {
27 schedulePub(args: ['cache' ,'foo'],
28 output: '''
29 Inspect the system cache.
30
31 Usage: pub cache list
32 ''',
33 error: 'Unknown cache command "foo".',
34 exitCode: 64);
35 });
36
37 integration('running pub cache list when there is no cache', () {
38 schedulePub(args: ['cache', 'list'], output: '{"packages":{}}');
39 });
40
41 integration('running pub cache list on empty cache', () {
42 // Set up a cache.
43 dir(cachePath, [
44 dir('hosted', [
45 dir('pub.dartlang.org', [
46 ])
47 ])
48 ]).scheduleCreate();
49
50 schedulePub(args: ['cache', 'list'], output: '{"packages":{}}');
51 });
52
53 integration('running pub cache list', () {
54 // Set up a cache.
55 dir(cachePath, [
56 dir('hosted', [
57 dir('pub.dartlang.org', [
58 dir("foo-1.2.3", [
59 libPubspec("foo", "1.2.3"),
60 libDir("foo")
61 ]),
62 dir("bar-2.0.0", [
63 libPubspec("bar", "2.0.0"),
64 libDir("bar") ])
65 ])
66 ])
67 ]).scheduleCreate();
68
69 schedulePub(args: ['cache', 'list'], output:
70 new RegExp(r'\{"packages":\{"bar":\{"version":"2\.0\.0","location":"[^"]+b ar-2\.0\.0"\},"foo":\{"version":"1\.2\.3","location":"[^"]+foo-1\.2\.3"\}\}\}$') );
71 });
72
73 }
OLDNEW
« no previous file with comments | « utils/pub/source.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698