diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-05 03:32:58 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-05 03:32:58 +0000 |
commit | 08f8cfe14e0f8937e3bcf8a22becdc5ce60b920e (patch) | |
tree | 30977064b5f93f9ac5b01b2a676f6d6ffdcec652 /test/rubygems/test_gem_commands_update_command.rb | |
parent | 593505ac6f802d2b5bff469425b7c76b65cc9b10 (diff) |
Merge RubyGems upstream: 56c0bbb69e4506bda7ef7f447dfec5db820df20b
It fixed the multiple vulnerabilities.
https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index 0247a03477..77851d32d6 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -543,4 +543,59 @@ class TestGemCommandsUpdateCommand < Gem::TestCase assert_empty out end + def test_explain_platform_local + local = Gem::Platform.local + spec_fetcher do |fetcher| + fetcher.download 'a', 2 + + fetcher.download 'a', 2 do |s| + s.platform = local + end + + fetcher.spec 'a', 1 + end + + @cmd.options[:explain] = true + @cmd.options[:args] = %w[a] + + use_ui @ui do + @cmd.execute + end + + out = @ui.output.split "\n" + + assert_equal "Gems to update:", out.shift + assert_equal " a-2-#{local}", out.shift + assert_empty out + end + + def test_explain_platform_ruby + local = Gem::Platform.local + spec_fetcher do |fetcher| + fetcher.download 'a', 2 + + fetcher.download 'a', 2 do |s| + s.platform = local + end + + fetcher.spec 'a', 1 + end + + # equivalent to --platform=ruby + Gem.platforms = [Gem::Platform::RUBY] + + @cmd.options[:explain] = true + @cmd.options[:args] = %w[a] + + use_ui @ui do + @cmd.execute + end + + out = @ui.output.split "\n" + + assert_equal "Gems to update:", out.shift + assert_equal " a-2", out.shift + assert_empty out + end + end |