Chromium Code Reviews| Index: test/must_pub_get_test.dart |
| diff --git a/test/must_pub_get_test.dart b/test/must_pub_get_test.dart |
| index e1f71eb71351151126fe91a78ac435e41c4279b9..6b47a523529d25aa16226084d0923bbc17eb50af 100644 |
| --- a/test/must_pub_get_test.dart |
| +++ b/test/must_pub_get_test.dart |
| @@ -286,6 +286,40 @@ foo:http://example.com/ |
| "SDK constraints. Please run \"pub get\" again."); |
| }); |
| + integration("the lock file's Flutter SDK constraint doesn't match the current " |
|
Bob Nystrom
2016/07/22 00:14:47
Long line.
nweiz
2016/07/22 00:45:01
Done.
|
| + "Flutter SDK", () { |
| + // Avoid using a path dependency because it triggers the full validation |
| + // logic. We want to be sure SDK-validation works without that logic. |
| + globalPackageServer.add((builder) { |
| + builder.serve("foo", "3.0.0", pubspec: { |
| + "environment": {"flutter": ">=1.0.0 <2.0.0"} |
| + }); |
| + }); |
| + |
| + d.dir('flutter', [ |
| + d.file('version', '1.2.3') |
| + ]).create(); |
| + |
| + d.dir(appPath, [ |
| + d.appPubspec({"foo": "3.0.0"}) |
| + ]).create(); |
| + |
| + pubGet(environment: {"FLUTTER_ROOT": p.join(sandboxDir, 'flutter')}); |
| + |
| + d.dir('flutter', [ |
| + d.file('version', '2.4.6') |
| + ]).create(); |
| + |
| + // Run pub manually here because otherwise we don't have access to |
| + // sandboxDir. |
| + schedulePub( |
| + args: ["run", "script"], |
| + environment: {"FLUTTER_ROOT": p.join(sandboxDir, 'flutter')}, |
| + error: "Flutter 2.4.6 is incompatible with your dependencies' SDK " |
| + "constraints. Please run \"pub get\" again.", |
| + exitCode: exit_codes.DATA); |
| + }); |
| + |
| group("a path dependency's dependency doesn't match the lockfile", () { |
| setUp(() { |
| d.dir("bar", [ |
| @@ -394,11 +428,43 @@ foo:http://example.com/ |
| _runsSuccessfully(); |
| }); |
| + |
| + integration("the lock file has a Flutter SDK but Flutter is unavailable", |
| + () { |
| + // Avoid using a path dependency because it triggers the full validation |
| + // logic. We want to be sure SDK-validation works without that logic. |
| + globalPackageServer.add((builder) { |
| + builder.serve("foo", "3.0.0", pubspec: { |
| + "environment": {"flutter": ">=1.0.0 <2.0.0"} |
| + }); |
| + }); |
| + |
| + d.dir('flutter', [ |
| + d.file('version', '1.2.3') |
| + ]).create(); |
| + |
| + d.dir(appPath, [ |
| + d.appPubspec({"foo": "3.0.0"}) |
| + ]).create(); |
| + |
| + pubGet(environment: {"FLUTTER_ROOT": p.join(sandboxDir, 'flutter')}); |
| + |
| + d.dir('flutter', [ |
| + d.file('version', '2.4.6') |
| + ]).create(); |
| + |
| + // Run pub manually here because otherwise we don't have access to |
| + // sandboxDir. |
| + schedulePub(args: ["run", "bin/script.dart"]); |
|
Bob Nystrom
2016/07/22 00:14:47
This isn't using sandboxDir. Can you just run pub
nweiz
2016/07/22 00:45:01
We use it above, in the initial pub get.
|
| + }); |
| }); |
| } |
| /// Runs every command that care about the world being up-to-date, and asserts |
| /// that it prints [message] as part of its error. |
| +/// |
| +/// If [environment] is passed, it's called to produce a map that's merged into |
| +/// the OS environment for the pub commands. |
| void _requiresPubGet(String message) { |
| for (var command in ["build", "serve", "run", "deps"]) { |
| integration("for pub $command", () { |