| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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_cache_test; | 5 library pub_cache_test; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:json' as json; | 8 import 'dart:json' as json; |
| 9 | 9 |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| 11 | 11 |
| 12 import '../lib/src/io.dart'; | 12 import '../lib/src/io.dart'; |
| 13 import 'descriptor.dart' as d; | 13 import 'descriptor.dart' as d; |
| 14 import 'test_pub.dart'; | 14 import 'test_pub.dart'; |
| 15 | 15 |
| 16 main() { | 16 main() { |
| 17 initConfig(); | 17 initConfig(); |
| 18 | 18 |
| 19 integration('running pub cache displays error message', () { | 19 integration('running pub cache displays error message', () { |
| 20 schedulePub(args: ['cache'], | 20 schedulePub(args: ['cache'], |
| 21 output: ''' | 21 output: ''' |
| 22 Inspect the system cache. | 22 Inspect the system cache. |
| 23 | 23 |
| 24 Usage: pub cache list | 24 Usage: pub cache list |
| 25 -h, --help Print usage information for this command. |
| 25 ''', | 26 ''', |
| 26 error: 'The cache command expects one argument.', | 27 error: 'The cache command expects one argument.', |
| 27 exitCode: 64); | 28 exitCode: 64); |
| 28 }); | 29 }); |
| 29 | 30 |
| 30 integration('running pub cache foo displays error message', () { | 31 integration('running pub cache foo displays error message', () { |
| 31 schedulePub(args: ['cache' ,'foo'], | 32 schedulePub(args: ['cache' ,'foo'], |
| 32 output: ''' | 33 output: ''' |
| 33 Inspect the system cache. | 34 Inspect the system cache. |
| 34 | 35 |
| 35 Usage: pub cache list | 36 Usage: pub cache list |
| 37 -h, --help Print usage information for this command. |
| 36 ''', | 38 ''', |
| 37 error: 'Unknown cache command "foo".', | 39 error: 'Unknown cache command "foo".', |
| 38 exitCode: 64); | 40 exitCode: 64); |
| 39 }); | 41 }); |
| 40 | 42 |
| 41 integration('running pub cache list when there is no cache', () { | 43 integration('running pub cache list when there is no cache', () { |
| 42 schedulePub(args: ['cache', 'list'], output: '{"packages":{}}'); | 44 schedulePub(args: ['cache', 'list'], output: '{"packages":{}}'); |
| 43 }); | 45 }); |
| 44 | 46 |
| 45 integration('running pub cache list on empty cache', () { | 47 integration('running pub cache list on empty cache', () { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 ]) | 89 ]) |
| 88 ]) | 90 ]) |
| 89 ]) | 91 ]) |
| 90 ]).create(); | 92 ]).create(); |
| 91 | 93 |
| 92 schedulePub(args: ['cache', 'list'], output: | 94 schedulePub(args: ['cache', 'list'], output: |
| 93 new RegExp(r'\{"packages":\{"foo":\{"version":"1\.2\.3","location":' | 95 new RegExp(r'\{"packages":\{"foo":\{"version":"1\.2\.3","location":' |
| 94 r'"[^"]+foo-1\.2\.3"\}\}\}$')); | 96 r'"[^"]+foo-1\.2\.3"\}\}\}$')); |
| 95 }); | 97 }); |
| 96 } | 98 } |
| OLD | NEW |