ruby-changes:61556
From: Benoit <ko1@a...>
Date: Fri, 5 Jun 2020 07:34:39 +0900 (JST)
Subject: [ruby-changes:61556] ff5ca548c3 (master): [rubygems/rubygems] Use a real file to run the test
https://git.ruby-lang.org/ruby.git/commit/?id=ff5ca548c3 From ff5ca548c3540c5a98a3851248248de117b2bf2f Mon Sep 17 00:00:00 2001 From: Benoit Daloze <eregontp@g...> Date: Sat, 9 May 2020 13:10:17 +0200 Subject: [rubygems/rubygems] Use a real file to run the test * JRuby doesn't support multi-line -e. https://github.com/rubygems/rubygems/commit/1fb6657a7d diff --git a/test/rubygems/test_require.rb b/test/rubygems/test_require.rb index 7a46093..56aa37f 100644 --- a/test/rubygems/test_require.rb +++ b/test/rubygems/test_require.rb @@ -463,13 +463,16 @@ class TestGemRequire < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_require.rb#L463 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/