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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_tests.dart
diff --git a/utils/tests/pub/pub_tests.dart b/utils/tests/pub/pub_tests.dart
index b269bc9eee67faef3e70f6c38e7b26afe3be7476..ea13565766b6c8942cb7b397a3e23ec73fcca7e4 100644
--- a/utils/tests/pub/pub_tests.dart
+++ b/utils/tests/pub/pub_tests.dart
@@ -11,9 +11,9 @@
main() {
group('running pub with no command', () {
- testOutput('displays usage',
- [],
- '''
+ testPub('displays usage',
+ args: [],
+ output: '''
Pub is a package manager for Dart.
Usage:
@@ -22,22 +22,45 @@ main() {
The commands are:
+ list print the contents of repositories
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'],
- '''
+ testPub('displays an error message',
+ args: ['quylthulg'],
+ output: '''
Unknown command "quylthulg".
Run "pub help" to see available commands.''',
exitCode: 64);
});
+
+ listCommand();
+ versionCommand();
+}
+
+listCommand() {
+ group('list cache', () {
+ testPub('treats an empty directory as a package',
+ cache: [
+ dir('apple'),
+ dir('banana'),
+ dir('cherry')
+ ],
+ args: ['list', 'cache'],
+ output: '''
+ apple
+ banana
+ cherry''');
+ });
}
+
+versionCommand() {
+ group('the version command', () {
+ testPub('displays the current version',
+ args: ['version'],
+ output: 'Pub 0.0.0');
+ });
+}
« 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