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

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

Issue 10091014: Start implementing pub object model. Rudimentary package cache class, and a simple pub command to l… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Platform is static now. Created 8 years, 8 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/pub.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | 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 #library('pub_tests'); 5 #library('pub_tests');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 8
9 #import('test_pub.dart'); 9 #import('test_pub.dart');
10 #import('../../../lib/unittest/unittest.dart'); 10 #import('../../../lib/unittest/unittest.dart');
11 11
12 main() { 12 main() {
13 group('running pub with no command', () { 13 group('running pub with no command', () {
14 testOutput('displays usage', 14 testPub('displays usage',
15 [], 15 args: [],
16 ''' 16 output: '''
17 Pub is a package manager for Dart. 17 Pub is a package manager for Dart.
18 18
19 Usage: 19 Usage:
20 20
21 pub command [arguments] 21 pub command [arguments]
22 22
23 The commands are: 23 The commands are:
24 24
25 list print the contents of repositories
25 version print Pub version 26 version print Pub version
26 27
27 Use "pub help [command]" for more information about a command.'''); 28 Use "pub help [command]" for more information about a command.''');
28 }); 29 });
29 30
30 group('the version command', () {
31 testOutput('displays the current version',
32 ['version'], 'Pub 0.0.0');
33 });
34
35 group('an unknown command', () { 31 group('an unknown command', () {
36 testOutput('displays an error message', 32 testPub('displays an error message',
37 ['quylthulg'], 33 args: ['quylthulg'],
38 ''' 34 output: '''
39 Unknown command "quylthulg". 35 Unknown command "quylthulg".
40 Run "pub help" to see available commands.''', 36 Run "pub help" to see available commands.''',
41 exitCode: 64); 37 exitCode: 64);
42 }); 38 });
39
40 listCommand();
41 versionCommand();
43 } 42 }
43
44 listCommand() {
45 group('list cache', () {
46 testPub('treats an empty directory as a package',
47 cache: [
48 dir('apple'),
49 dir('banana'),
50 dir('cherry')
51 ],
52 args: ['list', 'cache'],
53 output: '''
54 apple
55 banana
56 cherry''');
57 });
58 }
59
60 versionCommand() {
61 group('the version command', () {
62 testPub('displays the current version',
63 args: ['version'],
64 output: 'Pub 0.0.0');
65 });
66 }
OLDNEW
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698