| Index: sdk/lib/_internal/pub_generated/test/global/binstubs/name_collision_with_overwrite_test.dart
|
| diff --git a/sdk/lib/_internal/pub_generated/test/global/binstubs/name_collision_with_overwrite_test.dart b/sdk/lib/_internal/pub_generated/test/global/binstubs/name_collision_with_overwrite_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..278b722e7c4fe86aa78f514588066b3bf65c1c0a
|
| --- /dev/null
|
| +++ b/sdk/lib/_internal/pub_generated/test/global/binstubs/name_collision_with_overwrite_test.dart
|
| @@ -0,0 +1,47 @@
|
| +import 'package:scheduled_test/scheduled_stream.dart';
|
| +import 'package:scheduled_test/scheduled_test.dart';
|
| +import '../../descriptor.dart' as d;
|
| +import '../../test_pub.dart';
|
| +main() {
|
| + initConfig();
|
| + integration(
|
| + "does overwrite an existing binstub if --overwrite-executables " " is passed",
|
| + () {
|
| + d.dir("foo", [d.pubspec({
|
| + "name": "foo",
|
| + "executables": {
|
| + "foo": "foo",
|
| + "collide1": "foo",
|
| + "collide2": "foo"
|
| + }
|
| + }),
|
| + d.dir("bin", [d.file("foo.dart", "main() => print('ok');")])]).create();
|
| + d.dir("bar", [d.pubspec({
|
| + "name": "bar",
|
| + "executables": {
|
| + "bar": "bar",
|
| + "collide1": "bar",
|
| + "collide2": "bar"
|
| + }
|
| + }),
|
| + d.dir("bin", [d.file("bar.dart", "main() => print('ok');")])]).create();
|
| + schedulePub(args: ["global", "activate", "-spath", "../foo"]);
|
| + var pub = startPub(
|
| + args: ["global", "activate", "-spath", "../bar", "--overwrite-executables"]);
|
| + pub.stdout.expect(
|
| + consumeThrough("Installed executables bar, collide1 and collide2."));
|
| + pub.stderr.expect("Replaced collide1 previously installed from foo.");
|
| + pub.stderr.expect("Replaced collide2 previously installed from foo.");
|
| + pub.shouldExit();
|
| + d.dir(
|
| + cachePath,
|
| + [
|
| + d.dir(
|
| + "bin",
|
| + [
|
| + d.matcherFile("foo", contains("foo:foo")),
|
| + d.matcherFile("bar", contains("bar:bar")),
|
| + d.matcherFile("collide1", contains("bar:bar")),
|
| + d.matcherFile("collide2", contains("bar:bar"))])]).validate();
|
| + });
|
| +}
|
|
|