diff options
-rw-r--r-- | lib/rubygems/test_case.rb | 6 | ||||
-rw-r--r-- | test/rubygems/test_gem_commands_help_command.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_package_tar_writer.rb | 16 | ||||
-rw-r--r-- | test/rubygems/test_gem_request_set.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_gem_specification.rb | 2 | ||||
-rw-r--r-- | test/rubygems/test_remote_fetch_error.rb | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index f8a262130a..1278aa2c3a 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1558,12 +1558,12 @@ Also, a list: end class Object - def stub name, val_or_callable, *block_args + def stub(name, val_or_callable, *block_args) new_name = "__minitest_stub__#{name}" metaclass = class << self; self; end - if respond_to? name and not methods.map(&:to_s).include? name.to_s then + if respond_to? name and not methods.map(&:to_s).include? name.to_s metaclass.send :define_method, name do |*args| super(*args) end @@ -1572,7 +1572,7 @@ class Object metaclass.send :alias_method, new_name, name metaclass.send :define_method, name do |*args, &blk| - if val_or_callable.respond_to? :call then + if val_or_callable.respond_to? :call val_or_callable.call(*args, &blk) else blk.call(*block_args) if blk diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb index b85c6fb10f..24cf2d2250 100644 --- a/test/rubygems/test_gem_commands_help_command.rb +++ b/test/rubygems/test_gem_commands_help_command.rb @@ -48,7 +48,7 @@ class TestGemCommandsHelpCommand < Gem::TestCase if Gem::HAVE_OPENSSL assert_empty err - refute_match %r|No command found for |, out + refute_match %r{No command found for }, out end end end diff --git a/test/rubygems/test_gem_package_tar_writer.rb b/test/rubygems/test_gem_package_tar_writer.rb index b1fe23193a..925f018b2d 100644 --- a/test/rubygems/test_gem_package_tar_writer.rb +++ b/test/rubygems/test_gem_package_tar_writer.rb @@ -148,12 +148,12 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase end def test_add_file_simple - @tar_writer.add_file_simple 'x', 0644, 10 do |io| - io.write "a" * 10 - end + @tar_writer.add_file_simple 'x', 0644, 10 do |io| + io.write "a" * 10 + end - assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now), - @io.string[0, 512]) + assert_headers_equal(tar_file_header('x', '', 0644, 10, Time.now), + @io.string[0, 512]) assert_equal "aaaaaaaaaa#{"\0" * 502}", @io.string[512, 512] assert_equal 1024, @io.pos @@ -170,10 +170,10 @@ class TestGemPackageTarWriter < Gem::Package::TarTestCase end def test_add_file_simple_padding - @tar_writer.add_file_simple 'x', 0, 100 + @tar_writer.add_file_simple 'x', 0, 100 - assert_headers_equal tar_file_header('x', '', 0, 100, Time.now), - @io.string[0, 512] + assert_headers_equal tar_file_header('x', '', 0, 100, Time.now), + @io.string[0, 512] assert_equal "\0" * 512, @io.string[512, 512] end diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb index d15f5aee6b..404e9b61aa 100644 --- a/test/rubygems/test_gem_request_set.rb +++ b/test/rubygems/test_gem_request_set.rb @@ -87,7 +87,7 @@ Gems to install: a-2 EXPECTED - actual, _= capture_output do + actual, _ = capture_output do rs.install_from_gemdeps :gemdeps => io.path, :explain => true end assert_equal(expected, actual) diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 7e82793c90..d014eaea36 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2619,7 +2619,7 @@ end def test_to_yaml yaml_str = @a1.to_yaml - refute_match %r|!!null|, yaml_str + refute_match %r{!!null}, yaml_str same_spec = Gem::Specification.from_yaml(yaml_str) diff --git a/test/rubygems/test_remote_fetch_error.rb b/test/rubygems/test_remote_fetch_error.rb index 6602f8205b..a1c25bcdda 100644 --- a/test/rubygems/test_remote_fetch_error.rb +++ b/test/rubygems/test_remote_fetch_error.rb @@ -4,7 +4,7 @@ require 'rubygems/test_case' class TestRemoteFetchError < Gem::TestCase def test_password_redacted error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org') - refute_match %r|secret|, error.to_s + refute_match %r{secret}, error.to_s end def test_invalid_url |