Index: utils/tests/pub/pub_tests.dart |
diff --git a/utils/tests/pub/pub_tests.dart b/utils/tests/pub/pub_tests.dart |
index 53456fd48cdff396c75090e8c39e45b90674bb78..fe87c73b4b88dc2b215a443cb0fa6e11fd981c43 100644 |
--- a/utils/tests/pub/pub_tests.dart |
+++ b/utils/tests/pub/pub_tests.dart |
@@ -4,11 +4,40 @@ |
#library('pub_tests'); |
-// TODO(rnystrom): Better path to unittest. |
+#import('dart:io'); |
+ |
+#import('test_pub.dart'); |
#import('../../../lib/unittest/unittest_vm.dart'); |
main() { |
- test('should pass', () { |
- expect(1).equals(1); |
+ group('running pub with no command', () { |
+ testOutput('displays usage', |
+ [], |
+ ''' |
+ Pub is a package manager for Dart. |
+ |
+ Usage: |
+ |
+ pub command [arguments] |
+ |
+ The commands are: |
+ |
+ version print Pub version |
+ |
+ Use "pub help [command]" for more information about a command.'''); |
+ }); |
+ |
+ group('the version command', () { |
+ testOutput('displays the current version', |
+ ['version'], 'Pub 0.0.0'); |
+ }); |
+ |
+ group('an unknown command', () { |
+ testOutput('displays an error message', |
+ ['quylthulg'], |
+ ''' |
+ Unknown command "quylthulg". |
+ Run "pub help" to see available commands.''', |
+ exitCode: 64); |
}); |
} |