diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_help_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_help_command.rb | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb index 98e5b62be0..359da0a6d0 100644 --- a/test/rubygems/test_gem_commands_help_command.rb +++ b/test/rubygems/test_gem_commands_help_command.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "rubygems" require_relative "helper" require "rubygems/commands/help_command" @@ -11,41 +12,41 @@ class TestGemCommandsHelpCommand < Gem::TestCase @cmd = Gem::Commands::HelpCommand.new - load File.expand_path('rubygems_plugin.rb', __dir__) unless Gem::Commands.const_defined? :InterruptCommand + load File.expand_path("rubygems_plugin.rb", __dir__) unless Gem::Commands.const_defined? :InterruptCommand end def test_gem_help_bad - util_gem 'bad' do |out, err| - assert_equal('', out) + util_gem "bad" do |out, err| + assert_equal("", out) assert_match "Unknown command bad", err end end def test_gem_help_gem_dependencies - util_gem 'gem_dependencies' do |out, err| - assert_match 'gem.deps.rb', out - assert_equal '', err + util_gem "gem_dependencies" do |out, err| + assert_match "gem.deps.rb", out + assert_equal "", err end end def test_gem_help_platforms - util_gem 'platforms' do |out, err| + util_gem "platforms" do |out, err| assert_match(/x86-freebsd/, out) - assert_equal '', err + assert_equal "", err end end def test_gem_help_build - util_gem 'build' do |out, err| + util_gem "build" do |out, err| assert_match(/-C PATH *Run as if gem build was started in <PATH>/, out) - assert_equal '', err + assert_equal "", err end end def test_gem_help_commands mgr = Gem::CommandManager.new - util_gem 'commands' do |out, err| + util_gem "commands" do |out, err| mgr.command_names.each do |cmd| unless mgr[cmd].deprecated? assert_match(/\s+#{cmd}\s+\S+/, out) @@ -55,7 +56,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase if Gem::HAVE_OPENSSL assert_empty err - refute_match %r{No command found for }, out + refute_match(/No command found for /, out) end end end @@ -63,7 +64,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase def test_gem_help_commands_omits_deprecated_commands mgr = Gem::CommandManager.new - util_gem 'commands' do |out, err| + util_gem "commands" do |out, _err| deprecated_commands = mgr.command_names.select {|cmd| mgr[cmd].deprecated? } deprecated_commands.each do |cmd| refute_match(/\A\s+#{cmd}\s+\S+\z/, out) @@ -75,7 +76,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase util_gem do |out, err| assert_match(/Usage:/, out) assert_match(/gem install/, out) - assert_equal '', err + assert_equal "", err end end |