OLD | NEW |
| 1 // Copyright (c) 2013, 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
1 library pub_tests; | 5 library pub_tests; |
| 6 |
2 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
3 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
4 import 'utils.dart'; | 9 import 'utils.dart'; |
| 10 |
5 main() { | 11 main() { |
6 initConfig(); | 12 initConfig(); |
7 integration("responds with a 404 on incomplete special URLs", () { | 13 integration("responds with a 404 on incomplete special URLs", () { |
8 d.dir("foo", [d.libPubspec("foo", "0.0.1")]).create(); | 14 d.dir("foo", [d.libPubspec("foo", "0.0.1")]).create(); |
| 15 |
9 d.dir(appPath, [d.appPubspec({ | 16 d.dir(appPath, [d.appPubspec({ |
10 "foo": { | 17 "foo": { |
11 "path": "../foo" | 18 "path": "../foo" |
12 } | 19 } |
13 }), | 20 }), |
14 d.dir("lib", [d.file("packages")]), | 21 d.dir( |
15 d.dir("web", [d.file("packages")])]).create(); | 22 "lib", |
| 23 [// Make a file that maps to the special "packages" directory to e
nsure |
| 24 // it is *not* found. |
| 25 d.file("packages")]), d.dir("web", [d.file("packages")])]).create(); |
| 26 |
16 pubGet(); | 27 pubGet(); |
17 pubServe(); | 28 pubServe(); |
18 requestShould404("packages"); | 29 requestShould404("packages"); |
19 requestShould404("packages/"); | 30 requestShould404("packages/"); |
20 requestShould404("packages/myapp"); | 31 requestShould404("packages/myapp"); |
21 requestShould404("packages/myapp/"); | 32 requestShould404("packages/myapp/"); |
22 requestShould404("packages/foo"); | 33 requestShould404("packages/foo"); |
23 requestShould404("packages/foo/"); | 34 requestShould404("packages/foo/"); |
24 requestShould404("packages/unknown"); | 35 requestShould404("packages/unknown"); |
25 requestShould404("packages/unknown/"); | 36 requestShould404("packages/unknown/"); |
26 endPubServe(); | 37 endPubServe(); |
27 }); | 38 }); |
| 39 |
28 } | 40 } |
OLD | NEW |