summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_require.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb
index 7a460939a8..56aa37f65b 100644
--- a/test/rubygems/test_require.rb
+++ b/test/rubygems/test_require.rb
@@ -463,13 +463,16 @@ class TestGemRequire < Gem::TestCase
newer_json = util_spec("json", "999.99.9", nil, ["lib/json.rb"])
install_gem newer_json
- cmd = <<-RUBY
+ path = "#{@tempdir}/test_realworld_upgraded_default_gem.rb"
+ code = <<-RUBY
$stderr = $stdout
require "json"
puts Gem.loaded_specs["json"].version
puts $LOADED_FEATURES
RUBY
- output = Gem::Util.popen({ 'GEM_HOME' => @gemhome }, *ruby_with_rubygems_in_load_path, "-e", cmd).strip
+ File.write(path, code)
+
+ output = Gem::Util.popen({ 'GEM_HOME' => @gemhome }, *ruby_with_rubygems_in_load_path, path).strip
assert $?.success?
refute_empty output
assert_equal "999.99.9", output.lines[0].chomp