Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library pub_cache_test; | |
| 6 | |
| 7 import 'dart:io'; | |
| 8 import 'dart:json' as json; | |
| 9 import 'test_pub.dart'; | |
| 10 import '../../pub/io.dart'; | |
| 11 | |
| 12 | |
| 13 main() { | |
| 14 initConfig(); | |
| 15 | |
| 16 integration('running pub cache list', () { | |
| 17 | |
|
Bob Nystrom
2013/03/12 22:12:03
Remove this empty line.
keertip
2013/03/13 15:55:00
Done.
| |
| 18 servePackages([package("foo", "1.2.3")]); | |
|
Bob Nystrom
2013/03/12 22:12:03
Since you're actually creating the cache, you can
keertip
2013/03/13 15:55:00
Done.
keertip
2013/03/13 15:55:00
Done.
| |
| 19 | |
| 20 // Set up a cache. | |
| 21 dir(cachePath, [ | |
| 22 dir('hosted', [ | |
| 23 async(port.then((p) => dir('pub.dartlang.org', [ | |
|
Bob Nystrom
2013/03/12 22:12:03
...and async(port.then((p) =>
(since you don't us
keertip
2013/03/13 15:55:00
Done.
| |
| 24 dir("foo-1.2.3", [ | |
| 25 libPubspec("foo", "1.2.3"), | |
| 26 libDir("foo") | |
| 27 ]) | |
|
Bob Nystrom
2013/03/12 22:12:03
Let's add another package here too to make sure it
keertip
2013/03/13 15:55:00
Done.
| |
| 28 ]))) | |
| 29 ]) | |
| 30 ]).scheduleCreate(); | |
| 31 | |
| 32 | |
| 33 appDir([dependency("foo", "1.2.3")]).scheduleCreate(); | |
|
Bob Nystrom
2013/03/12 22:12:03
...and this...
keertip
2013/03/13 15:55:00
Done.
keertip
2013/03/13 15:55:00
Done.
| |
| 34 | |
| 35 schedulePub(args: ['install'], | |
| 36 output: new RegExp("Dependencies installed!\$")); | |
|
Bob Nystrom
2013/03/12 22:12:03
..and this...
keertip
2013/03/13 15:55:00
Done.
| |
| 37 | |
| 38 cacheDir({"foo": "1.2.3"}).scheduleValidate(); | |
|
Bob Nystrom
2013/03/12 22:12:03
..and this...
Bob Nystrom
2013/03/12 22:12:03
...and this...
keertip
2013/03/13 15:55:00
Done.
keertip
2013/03/13 15:55:00
Done.
keertip
2013/03/13 15:55:00
Done.
| |
| 39 | |
| 40 schedulePub(args: ['cache', 'list'], output: | |
| 41 new RegExp(r'{"pubcache":{"foo":{"version":"1.2.3","location":"[^"]+foo-1. 2.3"}}}$')); | |
|
Bob Nystrom
2013/03/12 22:12:03
Instead of a RegExp, it's probably simpler here to
nweiz
2013/03/12 22:58:48
I think a RegExp is right... the location can vary
keertip
2013/03/13 15:55:00
Done.
| |
| 42 }); | |
| 43 | |
|
Bob Nystrom
2013/03/12 22:12:03
Add tests that:
1. It exits with the right error
keertip
2013/03/13 15:55:00
Done.
| |
| 44 } | |
| 45 | |
| OLD | NEW |