diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb index a837f16e48..595cd35f62 100644 --- a/test/rubygems/test_gem_platform.rb +++ b/test/rubygems/test_gem_platform.rb @@ -231,7 +231,7 @@ class TestGemPlatform < Gem::TestCase my = Gem::Platform.new %w[cpu my_platform 1] other = Gem::Platform.new %w[cpu other_platform 1] - assert(my === my) + assert(my === my) # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands refute(other === my) refute(my === other) end diff --git a/test/rubygems/test_gem_source.rb b/test/rubygems/test_gem_source.rb index fa82098dc5..8cdecb6de7 100644 --- a/test/rubygems/test_gem_source.rb +++ b/test/rubygems/test_gem_source.rb @@ -194,7 +194,7 @@ class TestGemSource < Gem::TestCase installed = Gem::Source::Installed.new local = Gem::Source::Local.new - assert_equal(0, remote.<=>(remote), "remote <=> remote") + assert_equal(0, remote.<=>(remote), "remote <=> remote") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(-1, remote.<=>(specific), "remote <=> specific") assert_equal(1, specific.<=>(remote), "specific <=> remote") @@ -215,7 +215,7 @@ class TestGemSource < Gem::TestCase sourceA = Gem::Source.new "http://example.com/a" sourceB = Gem::Source.new "http://example.com/b" - assert_equal(0, sourceA.<=>(sourceA), "sourceA <=> sourceA") + assert_equal(0, sourceA.<=>(sourceA), "sourceA <=> sourceA") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, sourceA.<=>(sourceB), "sourceA <=> sourceB") assert_equal(1, sourceB.<=>(sourceA), "sourceB <=> sourceA") end diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index 1c8fcf9e9f..5bd1097958 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -215,7 +215,7 @@ class TestGemSourceGit < Gem::TestCase installed = Gem::Source::Installed.new vendor = Gem::Source::Vendor.new "vendor/foo" - assert_equal(0, git.<=>(git), "git <=> git") + assert_equal(0, git.<=>(git), "git <=> git") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, git.<=>(remote), "git <=> remote") assert_equal(-1, remote.<=>(git), "remote <=> git") diff --git a/test/rubygems/test_gem_source_installed.rb b/test/rubygems/test_gem_source_installed.rb index 5638e4b0b8..a04d5307c5 100644 --- a/test/rubygems/test_gem_source_installed.rb +++ b/test/rubygems/test_gem_source_installed.rb @@ -14,7 +14,7 @@ class TestGemSourceInstalled < Gem::TestCase git = Gem::Source::Git.new "a", "a", nil vendor = Gem::Source::Vendor.new "a" - assert_equal(0, installed.<=>(installed), "installed <=> installed") + assert_equal(0, installed.<=>(installed), "installed <=> installed") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(-1, remote.<=>(installed), "remote <=> installed") assert_equal(1, installed.<=>(remote), "installed <=> remote") diff --git a/test/rubygems/test_gem_source_local.rb b/test/rubygems/test_gem_source_local.rb index 2e16389850..0c3810562a 100644 --- a/test/rubygems/test_gem_source_local.rb +++ b/test/rubygems/test_gem_source_local.rb @@ -92,7 +92,7 @@ class TestGemSourceLocal < Gem::TestCase installed = Gem::Source::Installed.new local = Gem::Source::Local.new - assert_equal(0, local.<=>(local), "local <=> local") + assert_equal(0, local.<=>(local), "local <=> local") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(-1, remote.<=>(local), "remote <=> local") assert_equal(1, local.<=>(remote), "local <=> remote") diff --git a/test/rubygems/test_gem_source_lock.rb b/test/rubygems/test_gem_source_lock.rb index 6344feec59..cc07e36dc3 100644 --- a/test/rubygems/test_gem_source_lock.rb +++ b/test/rubygems/test_gem_source_lock.rb @@ -39,9 +39,11 @@ class TestGemSourceLock < Gem::TestCase vendor = Gem::Source::Vendor.new "vendor/a" v_lock = Gem::Source::Lock.new vendor + # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(0, g_lock.<=>(g_lock), "g_lock <=> g_lock") assert_equal(0, i_lock.<=>(i_lock), "i_lock <=> i_lock") assert_equal(0, v_lock.<=>(v_lock), "v_lock <=> v_lock") + # rubocop:enable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, g_lock.<=>(i_lock), "g_lock <=> i_lock") assert_equal(-1, i_lock.<=>(g_lock), "i_lock <=> g_lock") diff --git a/test/rubygems/test_gem_source_specific_file.rb b/test/rubygems/test_gem_source_specific_file.rb index f9a572b76d..7543fcb1b4 100644 --- a/test/rubygems/test_gem_source_specific_file.rb +++ b/test/rubygems/test_gem_source_specific_file.rb @@ -45,7 +45,7 @@ class TestGemSourceSpecificFile < Gem::TestCase installed = Gem::Source::Installed.new local = Gem::Source::Local.new - assert_equal(0, specific.<=>(specific), "specific <=> specific") + assert_equal(0, specific.<=>(specific), "specific <=> specific") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(-1, remote.<=>(specific), "remote <=> specific") assert_equal(1, specific.<=>(remote), "specific <=> remote") @@ -69,7 +69,7 @@ class TestGemSourceSpecificFile < Gem::TestCase assert_nil a1_source.<=>(b1_source), "a1_source <=> b1_source" assert_equal(-1, a1_source.<=>(a2_source), "a1_source <=> a2_source") - assert_equal(0, a1_source.<=>(a1_source), "a1_source <=> a1_source") + assert_equal(0, a1_source.<=>(a1_source), "a1_source <=> a1_source") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, a2_source.<=>(a1_source), "a2_source <=> a1_source") end end diff --git a/test/rubygems/test_gem_source_vendor.rb b/test/rubygems/test_gem_source_vendor.rb index 50a446c90f..1e24e93f35 100644 --- a/test/rubygems/test_gem_source_vendor.rb +++ b/test/rubygems/test_gem_source_vendor.rb @@ -15,7 +15,7 @@ class TestGemSourceVendor < Gem::TestCase git = Gem::Source::Git.new "a", "a", nil installed = Gem::Source::Installed.new - assert_equal(0, vendor.<=>(vendor), "vendor <=> vendor") + assert_equal(0, vendor.<=>(vendor), "vendor <=> vendor") # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, vendor.<=>(remote), "vendor <=> remote") assert_equal(-1, remote.<=>(vendor), "remote <=> vendor") diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index a49a0d32b9..4d8e37fb9a 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -2194,7 +2194,7 @@ dependencies: [] s2 = util_spec "b", "1" assert_equal(-1, (s1 <=> s2)) - assert_equal(0, (s1 <=> s1)) + assert_equal(0, (s1 <=> s1)) # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, (s2 <=> s1)) end @@ -2205,7 +2205,7 @@ dependencies: [] end assert_equal(-1, (s1 <=> s2)) - assert_equal(0, (s1 <=> s1)) + assert_equal(0, (s1 <=> s1)) # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, (s2 <=> s1)) end @@ -2214,7 +2214,7 @@ dependencies: [] s2 = util_spec "a", "2" assert_equal(-1, (s1 <=> s2)) - assert_equal(0, (s1 <=> s1)) + assert_equal(0, (s1 <=> s1)) # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands assert_equal(1, (s2 <=> s1)) end @@ -2438,7 +2438,7 @@ end def test_to_ruby_nested_hash metadata = {} - metadata[metadata] = metadata + metadata[:metadata] = {} @a2.metadata = metadata