diff options
author | Ellen Marie Dash <[email protected]> | 2020-07-30 17:24:05 -0400 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2020-09-28 14:54:22 +0900 |
commit | e8274a7683645082e96ced6a00d2df9ba10942ed (patch) | |
tree | e3ad9a71ea54df61031199f0399f1e74c7a9c6a6 /test/rubygems/test_gem_commands_update_command.rb | |
parent | 7fc8f83edbfe0bb220750e179b70e1bff57f1e5f (diff) |
[rubygems/rubygems] Add test for "gem update --system --silent"
https://github.com/rubygems/rubygems/commit/c3fb0db930
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3599
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index eed799c5aa..cacde06fd5 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -276,6 +276,34 @@ class TestGemCommandsUpdateCommand < Gem::TestCase Gem.disable_system_update_message = old_disable_system_update_message end + # The other style of `gem update --system` tests don't actually run + # setup.rb, so we just check that setup.rb gets the `--silent` flag. + def test_execute_system_silent_passed_to_setuprb + @cmd.options[:args] = [] + @cmd.options[:system] = true + @cmd.options[:silent] = true + + assert_equal true, @cmd.update_rubygems_arguments.include?('--silent') + end + + def test_execute_system_silent + spec_fetcher do |fetcher| + fetcher.download 'rubygems-update', 9 do |s| + s.files = %w[setup.rb] + end + end + + @cmd.options[:args] = [] + @cmd.options[:system] = true + @cmd.options[:silent] = true + + use_ui @ui do + @cmd.execute + end + + assert_empty @ui.output + end + # before: # a1 -> c1.2 # after: |