summaryrefslogtreecommitdiff
path: root/test/rubygems/test_rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_rubygems.rb')
-rw-r--r--test/rubygems/test_rubygems.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/rubygems/test_rubygems.rb b/test/rubygems/test_rubygems.rb
index 8bd116646f..ec195b65cd 100644
--- a/test/rubygems/test_rubygems.rb
+++ b/test/rubygems/test_rubygems.rb
@@ -1,8 +1,10 @@
+# frozen_string_literal: true
+
require_relative "helper"
class GemTest < Gem::TestCase
def test_rubygems_normal_behaviour
- _ = Gem::Util.popen(*ruby_with_rubygems_in_load_path, "-e", "'require \"rubygems\"'", { :err => [:child, :out] }).strip
+ _ = Gem::Util.popen(*ruby_with_rubygems_in_load_path, "-e", "'require \"rubygems\"'", { err: [:child, :out] }).strip
assert $?.success?
end
@@ -13,9 +15,9 @@ class GemTest < Gem::TestCase
intentionally_not_implemented_method
RUBY
- output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), "-e", "'require \"rubygems\"'", { :err => [:child, :out] }).strip
+ 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, "undefined local variable or method `intentionally_not_implemented_method'"
+ assert_match(/undefined local variable or method [`']intentionally_not_implemented_method'/, output)
assert_includes output, "Loading the #{operating_system_rb_at(path)} 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 " \
@@ -40,7 +42,7 @@ class GemTest < Gem::TestCase
*ruby_with_rubygems_and_fake_operating_system_in_load_path(path),
"-e",
"require \"rubygems\"; puts Gem::Specification.stubs.map(&:full_name)",
- { :err => [:child, :out] }
+ { err: [:child, :out] }
).strip
begin
assert_empty output
@@ -69,6 +71,6 @@ class GemTest < Gem::TestCase
end
def ruby_with_rubygems_and_fake_operating_system_in_load_path(operating_system_path)
- [Gem.ruby, "-I", operating_system_path, "-I" , $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) }]
+ [Gem.ruby, "-I", operating_system_path, "-I", $LOAD_PATH.find {|p| p == File.dirname($LOADED_FEATURES.find {|f| f.end_with?("/rubygems.rb") }) }]
end
end