mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Use a real file to run the test
* JRuby doesn't support multi-line -e.
1fb6657a7d
This commit is contained in:
parent
ae3d0d8a20
commit
ff5ca548c3
Notes:
git
2020-06-05 07:33:38 +09:00
1 changed files with 5 additions and 2 deletions
|
@ -463,13 +463,16 @@ class TestGemRequire < Gem::TestCase
|
||||||
newer_json = util_spec("json", "999.99.9", nil, ["lib/json.rb"])
|
newer_json = util_spec("json", "999.99.9", nil, ["lib/json.rb"])
|
||||||
install_gem newer_json
|
install_gem newer_json
|
||||||
|
|
||||||
cmd = <<-RUBY
|
path = "#{@tempdir}/test_realworld_upgraded_default_gem.rb"
|
||||||
|
code = <<-RUBY
|
||||||
$stderr = $stdout
|
$stderr = $stdout
|
||||||
require "json"
|
require "json"
|
||||||
puts Gem.loaded_specs["json"].version
|
puts Gem.loaded_specs["json"].version
|
||||||
puts $LOADED_FEATURES
|
puts $LOADED_FEATURES
|
||||||
RUBY
|
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?
|
assert $?.success?
|
||||||
refute_empty output
|
refute_empty output
|
||||||
assert_equal "999.99.9", output.lines[0].chomp
|
assert_equal "999.99.9", output.lines[0].chomp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue