[rubygems/rubygems] Have "gem exec" sort executable names in error message.

This decouples `gem exec` behavior (and tests) from the sort order of
the gemspec.

https://github.com/rubygems/rubygems/commit/911cd29159
This commit is contained in:
Ellen Marie Dash 2025-03-25 18:19:56 -04:00 committed by Hiroshi SHIBATA
parent 9f17a0c7cb
commit af594f5166
2 changed files with 2 additions and 2 deletions

View File

@ -216,7 +216,7 @@ to the same gem path as user-installed gems.
if spec.executables.size > 1
alert_error "Ambiguous which executable from gem `#{executable}` should be run: " \
"the options are #{spec.executables}, specify one via COMMAND, and use `-g` and `-v` to specify gem and version"
"the options are #{spec.executables.sort}, specify one via COMMAND, and use `-g` and `-v` to specify gem and version"
terminate_interaction 1
end

View File

@ -374,7 +374,7 @@ class TestGemCommandsExecCommand < Gem::TestCase
@cmd.invoke "a:2"
end
assert_equal 1, e.exit_code
assert_equal "ERROR: Ambiguous which executable from gem `a` should be run: the options are [\"foo\", \"bar\"], specify one via COMMAND, and use `-g` and `-v` to specify gem and version\n", @ui.error
assert_equal "ERROR: Ambiguous which executable from gem `a` should be run: the options are [\"bar\", \"foo\"], specify one via COMMAND, and use `-g` and `-v` to specify gem and version\n", @ui.error
end
end