| 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 #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'); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 exitCode: 64); | 53 exitCode: 64); |
| 54 }); | 54 }); |
| 55 }); | 55 }); |
| 56 | 56 |
| 57 group('pub list', listCommand); | 57 group('pub list', listCommand); |
| 58 group('pub install', installCommand); | 58 group('pub install', installCommand); |
| 59 group('pub version', versionCommand); | 59 group('pub version', versionCommand); |
| 60 } | 60 } |
| 61 | 61 |
| 62 listCommand() { | 62 listCommand() { |
| 63 // TODO(rnystrom): We don't currently have any sources that are cached, so |
| 64 // we can't test this right now. |
| 65 /* |
| 63 group('cache', () { | 66 group('cache', () { |
| 64 test('treats an empty directory as a package', () { | 67 test('treats an empty directory as a package', () { |
| 65 dir(cachePath, [ | 68 dir(cachePath, [ |
| 66 dir('sdk', [ | 69 dir('sdk', [ |
| 67 dir('apple'), | 70 dir('apple'), |
| 68 dir('banana'), | 71 dir('banana'), |
| 69 dir('cherry') | 72 dir('cherry') |
| 70 ]) | 73 ]) |
| 71 ]).scheduleCreate(); | 74 ]).scheduleCreate(); |
| 72 | 75 |
| 73 runPub(args: ['list', 'cache'], | 76 runPub(args: ['list', 'cache'], |
| 74 output: ''' | 77 output: ''' |
| 75 From system cache: | 78 From system cache: |
| 76 apple from sdk | 79 apple 0.0.0 (apple from sdk) |
| 77 banana from sdk | 80 banana 0.0.0 (banana from sdk) |
| 78 cherry from sdk | 81 cherry 0.0.0 (cherry from sdk) |
| 79 '''); | 82 '''); |
| 80 }); | 83 }); |
| 81 }); | 84 }); |
| 85 */ |
| 82 } | 86 } |
| 83 | 87 |
| 84 installCommand() { | 88 installCommand() { |
| 85 test('adds a dependent package', () { | 89 test('adds a dependent package', () { |
| 86 dir(sdkPath, [ | 90 dir(sdkPath, [ |
| 87 dir('lib', [ | 91 dir('lib', [ |
| 88 dir('foo', [ | 92 dir('foo', [ |
| 89 file('foo.dart', 'main() => "foo";') | 93 file('foo.dart', 'main() => "foo";') |
| 90 ]) | 94 ]) |
| 91 ]) | 95 ]) |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 199 |
| 196 runPub(args: ['install'], | 200 runPub(args: ['install'], |
| 197 output: const RegExp("Dependencies installed!\$")); | 201 output: const RegExp("Dependencies installed!\$")); |
| 198 }); | 202 }); |
| 199 } | 203 } |
| 200 | 204 |
| 201 versionCommand() { | 205 versionCommand() { |
| 202 test('displays the current version', () => | 206 test('displays the current version', () => |
| 203 runPub(args: ['version'], output: VERSION_STRING)); | 207 runPub(args: ['version'], output: VERSION_STRING)); |
| 204 } | 208 } |
| OLD | NEW |