diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-17 01:29:22 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-17 01:29:22 +0000 |
commit | f5d0f32e4650928b4a243d95b40ee1ed190b89cd (patch) | |
tree | 6ce8d14bd2fd646ca55c80f9676688b2616b4dd1 /test/rubygems/test_gem.rb | |
parent | 8b8d8e19862464e761590e6fc67823befebad5bd (diff) | |
download | ruby-f5d0f32e4650928b4a243d95b40ee1ed190b89cd.tar.gz |
Merge rubygems-2.6.11
This version fixed regression of rubygems-2.6.10.
https://github.com/rubygems/rubygems/pull/1856
See details of changelogs for 2.6.11 release:
https://github.com/rubygems/rubygems/blob/adfcf40502716080bd9cdfdd2e43bd4296872784/History.txt#L3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem.rb')
-rw-r--r-- | test/rubygems/test_gem.rb | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 0b533c5f31..a605f9cdfe 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1443,21 +1443,24 @@ class TestGem < Gem::TestCase ENV['RUBYGEMS_GEMDEPS'] = "-" path = File.join @tempdir, "gem.deps.rb" + cmd = [Gem.ruby.dup.untaint, "-I#{LIB_PATH.untaint}", "-rubygems"] + if RUBY_VERSION < '1.9' + cmd << "-e 'puts Gem.loaded_specs.values.map(&:full_name).sort'" + cmd = cmd.join(' ') + else + cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort" + end File.open path, "w" do |f| f.puts "gem 'a'" end - out0 = IO.popen([Gem.ruby.dup.untaint, "-I#{LIB_PATH}", "-rubygems", - "-eputs Gem.loaded_specs.values.map(&:full_name).sort"], - &:read).split(/\n/) + out0 = IO.popen(cmd, &:read).split(/\n/) File.open path, "a" do |f| f.puts "gem 'b'" f.puts "gem 'c'" end - out = IO.popen([Gem.ruby.dup.untaint, "-I#{LIB_PATH}", "-rubygems", - "-eputs Gem.loaded_specs.values.map(&:full_name).sort"], - &:read).split(/\n/) + out = IO.popen(cmd, &:read).split(/\n/) assert_equal ["b-1", "c-1"], out - out0 end @@ -1482,21 +1485,24 @@ class TestGem < Gem::TestCase Dir.mkdir "sub1" path = File.join @tempdir, "gem.deps.rb" + cmd = [Gem.ruby.dup.untaint, "-Csub1", "-I#{LIB_PATH.untaint}", "-rubygems"] + if RUBY_VERSION < '1.9' + cmd << "-e 'puts Gem.loaded_specs.values.map(&:full_name).sort'" + cmd = cmd.join(' ') + else + cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort" + end File.open path, "w" do |f| f.puts "gem 'a'" end - out0 = IO.popen([Gem.ruby.dup.untaint, "-Csub1", "-I#{LIB_PATH}", "-rubygems", - "-eputs Gem.loaded_specs.values.map(&:full_name).sort"], - &:read).split(/\n/) + out0 = IO.popen(cmd, &:read).split(/\n/) File.open path, "a" do |f| f.puts "gem 'b'" f.puts "gem 'c'" end - out = IO.popen([Gem.ruby.dup.untaint, "-Csub1", "-I#{LIB_PATH}", "-rubygems", - "-eputs Gem.loaded_specs.values.map(&:full_name).sort"], - &:read).split(/\n/) + out = IO.popen(cmd, &:read).split(/\n/) Dir.rmdir "sub1" |