1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Reword the message

For errors that could happened while loading `rubygems/defaults/operating_system`

https://github.com/rubygems/rubygems/commit/6e1e2141f8
This commit is contained in:
Daniel Niknam 2021-08-08 19:40:05 +10:00 committed by Hiroshi SHIBATA
parent 7d859489e1
commit 34e073c0ca
Notes: git 2021-08-31 19:07:09 +09:00
2 changed files with 11 additions and 2 deletions

View file

@ -1333,7 +1333,12 @@ begin
rescue LoadError
# Ignored
rescue Exception => e
raise e.class, "#{e.message}\nThis is not expected so please report this issue to your OS support and ask for help."
msg = "#{e.message}\n" \
"Loading the rubygems/defaults/operating_system.rb file caused an error. " \
"This file is owned by your OS, not by rubygems upstream. " \
"Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
"the problem and ask for help."
raise e.class, msg
end
begin

View file

@ -15,7 +15,11 @@ class GemTest < Gem::TestCase
output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip
assert !$?.success?
assert_includes output, "This is not expected so please report this issue to your OS support and ask for help"
assert_includes output, "unterminated string meets end of file (SyntaxError)"
assert_includes output, "Loading the rubygems/defaults/operating_system.rb file caused an error. " \
"This file is owned by your OS, not by rubygems upstream. " \
"Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
"the problem and ask for help."
end
private