OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:pub/src/exit_codes.dart' as exit_codes; | 9 import 'package:pub/src/exit_codes.dart' as exit_codes; |
10 import 'package:pub/src/io.dart'; | 10 import 'package:pub/src/io.dart'; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 "SDK constraints. Please run \"pub get\" again."); | 286 "SDK constraints. Please run \"pub get\" again."); |
287 }); | 287 }); |
288 | 288 |
289 group("a path dependency's dependency doesn't match the lockfile", () { | 289 group("a path dependency's dependency doesn't match the lockfile", () { |
290 setUp(() { | 290 setUp(() { |
291 d.dir("bar", [ | 291 d.dir("bar", [ |
292 d.libPubspec("bar", "1.0.0", deps: {"foo": "1.0.0"}) | 292 d.libPubspec("bar", "1.0.0", deps: {"foo": "1.0.0"}) |
293 ]).create(); | 293 ]).create(); |
294 | 294 |
295 d.dir(appPath, [ | 295 d.dir(appPath, [ |
296 d.appPubspec({"foo": {"path": "../foo"}}) | 296 d.appPubspec({"bar": {"path": "../bar"}}) |
297 ]); | 297 ]).create(); |
298 | 298 |
299 pubGet(); | 299 pubGet(); |
300 | 300 |
301 // Update foo's pubspec without touching the app's. | 301 // Update bar's pubspec without touching the app's. |
302 d.dir("bar", [ | 302 d.dir("bar", [ |
303 d.libPubspec("bar", "1.0.0", deps: {"foo": "2.0.0"}) | 303 d.libPubspec("bar", "1.0.0", deps: {"foo": "2.0.0"}) |
304 ]).create(); | 304 ]).create(); |
305 }); | 305 }); |
| 306 |
| 307 _requiresPubGet('${p.join('..', 'bar', 'pubspec.yaml')} has changed ' |
| 308 'since the pubspec.lock file was generated, please run "pub get" ' |
| 309 'again.'); |
306 }); | 310 }); |
307 }); | 311 }); |
308 | 312 |
309 group("doesn't require the user to run pub get first if", () { | 313 group("doesn't require the user to run pub get first if", () { |
310 group("the pubspec is older than the lockfile which is older than the " | 314 group("the pubspec is older than the lockfile which is older than the " |
311 "packages file, even if the contents are wrong", () { | 315 "packages file, even if the contents are wrong", () { |
312 setUp(() { | 316 setUp(() { |
313 d.dir(appPath, [ | 317 d.dir(appPath, [ |
314 d.appPubspec({"foo": "1.0.0"}) | 318 d.appPubspec({"foo": "1.0.0"}) |
315 ]).create(); | 319 ]).create(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 void _touch(String path) { | 416 void _touch(String path) { |
413 schedule(() async { | 417 schedule(() async { |
414 // Delay a bit to make sure the modification times are noticeably different. | 418 // Delay a bit to make sure the modification times are noticeably different. |
415 // 1s seems to be the finest granularity that dart:io reports. | 419 // 1s seems to be the finest granularity that dart:io reports. |
416 await new Future.delayed(new Duration(seconds: 1)); | 420 await new Future.delayed(new Duration(seconds: 1)); |
417 | 421 |
418 path = p.join(sandboxDir, "myapp", path); | 422 path = p.join(sandboxDir, "myapp", path); |
419 touch(path); | 423 touch(path); |
420 }, "touching $path"); | 424 }, "touching $path"); |
421 } | 425 } |
OLD | NEW |