OLD | NEW |
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 // TODO(rnystrom): Better path to unittest. | 7 #import('dart:io'); |
| 8 |
| 9 #import('test_pub.dart'); |
8 #import('../../../lib/unittest/unittest_vm.dart'); | 10 #import('../../../lib/unittest/unittest_vm.dart'); |
9 | 11 |
10 main() { | 12 main() { |
11 test('should pass', () { | 13 group('running pub with no command', () { |
12 expect(1).equals(1); | 14 testOutput('displays usage', |
| 15 [], |
| 16 ''' |
| 17 Pub is a package manager for Dart. |
| 18 |
| 19 Usage: |
| 20 |
| 21 pub command [arguments] |
| 22 |
| 23 The commands are: |
| 24 |
| 25 version print Pub version |
| 26 |
| 27 Use "pub help [command]" for more information about a command.'''); |
| 28 }); |
| 29 |
| 30 group('the version command', () { |
| 31 testOutput('displays the current version', |
| 32 ['version'], 'Pub 0.0.0'); |
| 33 }); |
| 34 |
| 35 group('an unknown command', () { |
| 36 testOutput('displays an error message', |
| 37 ['quylthulg'], |
| 38 ''' |
| 39 Unknown command "quylthulg". |
| 40 Run "pub help" to see available commands.''', |
| 41 exitCode: 64); |
13 }); | 42 }); |
14 } | 43 } |
OLD | NEW |