OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2012, 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 d.file. | 3 // BSD-style license that can be found in the LICENSE d.file. |
4 | 4 |
5 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
| 9 import '../../../../pkg/pathos/lib/path.dart' as path; |
9 import '../../../../pkg/scheduled_test/lib/scheduled_test.dart'; | 10 import '../../../../pkg/scheduled_test/lib/scheduled_test.dart'; |
10 | 11 |
| 12 import '../../../pub/io.dart'; |
11 import '../descriptor.dart' as d; | 13 import '../descriptor.dart' as d; |
12 import '../test_pub.dart'; | 14 import '../test_pub.dart'; |
13 | 15 |
14 main() { | 16 main() { |
15 initConfig(); | 17 initConfig(); |
16 | 18 |
17 group('requires', () { | 19 group('requires', () { |
18 integration('a pubspec', () { | 20 integration('a pubspec', () { |
19 d.dir(appPath, []).create(); | 21 d.dir(appPath, []).create(); |
20 | 22 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 109 |
108 schedulePub(args: ['install'], | 110 schedulePub(args: ['install'], |
109 output: new RegExp(r"Dependencies installed!$")); | 111 output: new RegExp(r"Dependencies installed!$")); |
110 | 112 |
111 d.dir(packagesPath, [ | 113 d.dir(packagesPath, [ |
112 d.nothing('foo'), | 114 d.nothing('foo'), |
113 d.dir('myapp', [d.file('myapp.dart', 'main() => "myapp";')]) | 115 d.dir('myapp', [d.file('myapp.dart', 'main() => "myapp";')]) |
114 ]).validate(); | 116 ]).validate(); |
115 }); | 117 }); |
116 | 118 |
| 119 integration('overwrites a broken packages directory symlink', () { |
| 120 d.dir(appPath, [ |
| 121 d.appPubspec([]), |
| 122 d.dir('packages'), |
| 123 d.libDir('myapp'), |
| 124 d.dir('bin') |
| 125 ]).create(); |
| 126 |
| 127 scheduleSymlink( |
| 128 path.join(appPath, 'packages'), |
| 129 path.join(appPath, 'bin', 'packages')); |
| 130 |
| 131 schedule(() => deleteEntry(path.join(sandboxDir, appPath, 'packages'))); |
| 132 |
| 133 schedulePub(args: ['install'], |
| 134 output: new RegExp(r"Dependencies installed!$")); |
| 135 |
| 136 d.dir(packagesPath, [ |
| 137 d.nothing('foo'), |
| 138 d.dir('myapp', [d.file('myapp.dart', 'main() => "myapp";')]) |
| 139 ]).validate(); |
| 140 }); |
| 141 |
117 group('creates a packages directory in', () { | 142 group('creates a packages directory in', () { |
118 integration('"test/" and its subdirectories', () { | 143 integration('"test/" and its subdirectories', () { |
119 d.dir(appPath, [ | 144 d.dir(appPath, [ |
120 d.appPubspec([]), | 145 d.appPubspec([]), |
121 d.libDir('foo'), | 146 d.libDir('foo'), |
122 d.dir("test", [d.dir("subtest")]) | 147 d.dir("test", [d.dir("subtest")]) |
123 ]).create(); | 148 ]).create(); |
124 | 149 |
125 schedulePub(args: ['install'], | 150 schedulePub(args: ['install'], |
126 output: new RegExp(r"Dependencies installed!$")); | 151 output: new RegExp(r"Dependencies installed!$")); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 d.dir("packages", [ | 267 d.dir("packages", [ |
243 d.dir("myapp", [ | 268 d.dir("myapp", [ |
244 d.file('foo.dart', 'main() => "foo";') | 269 d.file('foo.dart', 'main() => "foo";') |
245 ]) | 270 ]) |
246 ]) | 271 ]) |
247 ]) | 272 ]) |
248 ]).validate(); | 273 ]).validate(); |
249 }); | 274 }); |
250 }); | 275 }); |
251 } | 276 } |
OLD | NEW |