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 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import '../../descriptor.dart' as d; | 7 import '../../descriptor.dart' as d; |
8 import '../../test_pub.dart'; | 8 import '../../test_pub.dart'; |
9 | 9 |
10 main() { | 10 main() { |
11 integration('does not request a pubspec for a cached package', () { | 11 integration('does not request a pubspec for a cached package', () { |
12 servePackages((builder) => builder.serve("foo", "1.2.3")); | 12 servePackages((builder) => builder.serve("foo", "1.2.3")); |
13 | 13 |
14 d.appDir({"foo": "1.2.3"}).create(); | 14 d.appDir({"foo": "1.2.3"}).create(); |
15 | 15 |
16 // Get once so it gets cached. | 16 // Get once so it gets cached. |
17 pubGet(); | 17 pubGet(); |
18 | 18 |
19 // Clear the cache. We don't care about anything that was served during | 19 // Clear the cache. We don't care about anything that was served during |
20 // the initial get. | 20 // the initial get. |
21 globalServer.clearRequestedPaths(); | 21 globalServer.clearRequestedPaths(); |
22 | 22 |
23 d.cacheDir({"foo": "1.2.3"}).validate(); | 23 d.cacheDir({"foo": "1.2.3"}).validate(); |
24 d.packagesDir({"foo": "1.2.3"}).validate(); | 24 d.appPackagesFile({"foo": "1.2.3"}).validate(); |
25 | 25 |
26 // Run the solver again now that it's cached. | 26 // Run the solver again now that it's cached. |
27 pubGet(); | 27 pubGet(); |
28 | 28 |
29 // The get should not have requested the pubspec since it's local already. | 29 // The get should not have requested the pubspec since it's local already. |
30 globalServer.requestedPaths.then((paths) { | 30 globalServer.requestedPaths.then((paths) { |
31 expect(paths, isNot(contains("packages/foo/versions/1.2.3.yaml"))); | 31 expect(paths, isNot(contains("packages/foo/versions/1.2.3.yaml"))); |
32 }); | 32 }); |
33 }); | 33 }); |
34 } | 34 } |
OLD | NEW |