| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 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 | 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 '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
| 9 import 'utils.dart'; | 9 import 'utils.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 initConfig(); | 12 initConfig(); |
| 13 integration("responds with a 404 on incomplete special URLs", () { | 13 integration("responds with a 404 on incomplete special URLs", () { |
| 14 d.dir("foo", [ | 14 d.dir("foo", [ |
| 15 d.libPubspec("foo", "0.0.1") | 15 d.libPubspec("foo", "0.0.1") |
| 16 ]).create(); | 16 ]).create(); |
| 17 | 17 |
| 18 d.dir(appPath, [ | 18 d.dir(appPath, [ |
| 19 d.appPubspec({ | 19 d.appPubspec({ |
| 20 "foo": {"path": "../foo"} | 20 "foo": {"path": "../foo"} |
| 21 }), | 21 }), |
| 22 // Make files that map to the special directory names to ensure they | |
| 23 // are *not* found. | |
| 24 d.dir("asset", [ | |
| 25 d.file("packages"), | |
| 26 d.file("assets") | |
| 27 ]), | |
| 28 d.dir("lib", [ | 22 d.dir("lib", [ |
| 29 d.file("packages"), | 23 // Make a file that maps to the special "packages" directory to ensure |
| 30 d.file("assets") | 24 // it is *not* found. |
| 25 d.file("packages") |
| 31 ]), | 26 ]), |
| 32 d.dir("web", [ | 27 d.dir("web", [ |
| 33 d.file("packages"), | 28 d.file("packages") |
| 34 d.file("assets") | |
| 35 ]) | 29 ]) |
| 36 ]).create(); | 30 ]).create(); |
| 37 | 31 |
| 38 pubGet(); | 32 pubGet(); |
| 39 pubServe(); | 33 pubServe(); |
| 40 requestShould404("packages"); | 34 requestShould404("packages"); |
| 41 requestShould404("assets"); | |
| 42 requestShould404("packages/"); | 35 requestShould404("packages/"); |
| 43 requestShould404("assets/"); | |
| 44 requestShould404("packages/myapp"); | 36 requestShould404("packages/myapp"); |
| 45 requestShould404("assets/myapp"); | |
| 46 requestShould404("packages/myapp/"); | 37 requestShould404("packages/myapp/"); |
| 47 requestShould404("assets/myapp/"); | |
| 48 requestShould404("packages/foo"); | 38 requestShould404("packages/foo"); |
| 49 requestShould404("assets/foo"); | |
| 50 requestShould404("packages/foo/"); | 39 requestShould404("packages/foo/"); |
| 51 requestShould404("assets/foo/"); | |
| 52 requestShould404("packages/unknown"); | 40 requestShould404("packages/unknown"); |
| 53 requestShould404("assets/unknown"); | |
| 54 requestShould404("packages/unknown/"); | 41 requestShould404("packages/unknown/"); |
| 55 requestShould404("assets/unknown/"); | |
| 56 endPubServe(); | 42 endPubServe(); |
| 57 }); | 43 }); |
| 58 | 44 |
| 59 } | 45 } |
| OLD | NEW |