| OLD | NEW |
| 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 |
| 1 library pub_tests; | 5 library pub_tests; |
| 6 |
| 2 import '../../../lib/src/exit_codes.dart' as exit_codes; | 7 import '../../../lib/src/exit_codes.dart' as exit_codes; |
| 3 import '../../descriptor.dart' as d; | 8 import '../../descriptor.dart' as d; |
| 4 import '../../test_pub.dart'; | 9 import '../../test_pub.dart'; |
| 10 |
| 5 main() { | 11 main() { |
| 6 initConfig(); | 12 initConfig(); |
| 7 integration('gets a package from a pub server', () { | 13 integration('gets a package from a pub server', () { |
| 8 servePackages((builder) => builder.serve("foo", "1.2.3")); | 14 servePackages((builder) => builder.serve("foo", "1.2.3")); |
| 15 |
| 9 d.appDir({ | 16 d.appDir({ |
| 10 "foo": "1.2.3" | 17 "foo": "1.2.3" |
| 11 }).create(); | 18 }).create(); |
| 19 |
| 12 pubGet(); | 20 pubGet(); |
| 21 |
| 13 d.cacheDir({ | 22 d.cacheDir({ |
| 14 "foo": "1.2.3" | 23 "foo": "1.2.3" |
| 15 }).validate(); | 24 }).validate(); |
| 16 d.packagesDir({ | 25 d.packagesDir({ |
| 17 "foo": "1.2.3" | 26 "foo": "1.2.3" |
| 18 }).validate(); | 27 }).validate(); |
| 19 }); | 28 }); |
| 29 |
| 20 integration('URL encodes the package name', () { | 30 integration('URL encodes the package name', () { |
| 21 serveNoPackages(); | 31 serveNoPackages(); |
| 32 |
| 22 d.appDir({ | 33 d.appDir({ |
| 23 "bad name!": "1.2.3" | 34 "bad name!": "1.2.3" |
| 24 }).create(); | 35 }).create(); |
| 36 |
| 25 pubGet( | 37 pubGet( |
| 26 error: new RegExp( | 38 error: new RegExp( |
| 27 r"Could not find package bad name! at http://localhost:\d+\."), | 39 r"Could not find package bad name! at http://localhost:\d+\."), |
| 28 exitCode: exit_codes.UNAVAILABLE); | 40 exitCode: exit_codes.UNAVAILABLE); |
| 29 }); | 41 }); |
| 30 } | 42 } |
| OLD | NEW |