OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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 'package:path/path.dart' as p; | 7 import 'package:path/path.dart' as p; |
8 import 'package:pub/src/io.dart'; | 8 import 'package:pub/src/io.dart'; |
9 | 9 |
10 import '../../descriptor.dart' as d; | 10 import '../../descriptor.dart' as d; |
11 import '../../test_pub.dart'; | 11 import '../../test_pub.dart'; |
12 import '../utils.dart'; | 12 import '../utils.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 // TODO(rnystrom): Split into independent tests. | 15 // TODO(rnystrom): Split into independent tests. |
16 initConfig(); | |
17 integration("pathToUrls converts asset ids to matching URL paths", () { | 16 integration("pathToUrls converts asset ids to matching URL paths", () { |
18 d.dir("foo", [ | 17 d.dir("foo", [ |
19 d.libPubspec("foo", "1.0.0"), | 18 d.libPubspec("foo", "1.0.0"), |
20 d.dir("lib", [ | 19 d.dir("lib", [ |
21 d.file("foo.dart", "foo() => null;") | 20 d.file("foo.dart", "foo() => null;") |
22 ]) | 21 ]) |
23 ]).create(); | 22 ]).create(); |
24 | 23 |
25 d.dir(appPath, [ | 24 d.dir(appPath, [ |
26 d.appPubspec({"foo": {"path": "../foo"}}), | 25 d.appPubspec({"foo": {"path": "../foo"}}), |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 "path": canonicalize(p.join(sandboxDir, "foo", "lib", "foo.dart")) | 124 "path": canonicalize(p.join(sandboxDir, "foo", "lib", "foo.dart")) |
126 }, {"urls": [ | 125 }, {"urls": [ |
127 getServerUrl("test", "packages/foo/foo.dart"), | 126 getServerUrl("test", "packages/foo/foo.dart"), |
128 getServerUrl("web", "packages/foo/foo.dart"), | 127 getServerUrl("web", "packages/foo/foo.dart"), |
129 getServerUrl("randomdir", "packages/foo/foo.dart") | 128 getServerUrl("randomdir", "packages/foo/foo.dart") |
130 ]}); | 129 ]}); |
131 | 130 |
132 endPubServe(); | 131 endPubServe(); |
133 }); | 132 }); |
134 } | 133 } |
OLD | NEW |