From 243e65ac929ff8aa7111d936d4810623f8477dd3 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Wed, 13 May 2026 10:44:35 -0400 Subject: [PATCH 1/6] Add `rubocop-minitest` gem --- .rubocop.yml | 1 + Gemfile | 1 + Gemfile.lock | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 227652f9..ca4bbe00 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ plugins: - rubocop-sorbet + - rubocop-minitest inherit_gem: rubocop-shopify: rubocop.yml diff --git a/Gemfile b/Gemfile index ce828ab9..b96492ac 100644 --- a/Gemfile +++ b/Gemfile @@ -12,5 +12,6 @@ group :development do gem "debug" gem "rubocop-shopify", require: false gem "rubocop-sorbet", require: false + gem "rubocop-minitest", require: false gem "tapioca", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 86604ed2..70d8ea2a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,6 +87,10 @@ GEM rubocop-ast (1.49.0) parser (>= 3.3.7.2) prism (~> 1.7) + rubocop-minitest (0.38.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) rubocop-shopify (2.18.0) rubocop (~> 1.62) rubocop-sorbet (0.12.0) @@ -137,6 +141,7 @@ DEPENDENCIES minitest-mock minitest-reporters rake (~> 13.4.2) + rubocop-minitest rubocop-shopify rubocop-sorbet spoom! From 5cdfdf57c0dcdc0ed775092f04286fe82d0a9774 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Wed, 13 May 2026 10:49:03 -0400 Subject: [PATCH 2/6] `bin/style -a --only=Minitest/AssertEqual` --- test/spoom/context/git_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/spoom/context/git_test.rb b/test/spoom/context/git_test.rb index 9b49d87e..6ebc62a6 100644 --- a/test/spoom/context/git_test.rb +++ b/test/spoom/context/git_test.rb @@ -176,7 +176,7 @@ def test_context_git_last_commit assert(sha.size < 40) sha = T.must(context.git_last_commit(short_sha: false)).sha - assert(sha.size == 40) + assert_equal(sha.size, 40) last_commit = context.git_last_commit assert_equal(time.to_i, last_commit&.timestamp) From c566b5eca14d9a0f2ebe3965905d174f4b569c56 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Wed, 13 May 2026 10:49:22 -0400 Subject: [PATCH 3/6] `bin/style -a --only=Minitest/AssertIncludes,Minitest/RefuteIncludes` --- test/spoom/location_test.rb | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/spoom/location_test.rb b/test/spoom/location_test.rb index d022c48e..6127bd63 100644 --- a/test/spoom/location_test.rb +++ b/test/spoom/location_test.rb @@ -71,39 +71,39 @@ def test_raises_if_initialize_has_missing_attributes def test_include location1 = Location.new("foo.rb", start_line: 1, start_column: 2, end_line: 3, end_column: 4) location2 = Location.new("foo.rb", start_line: 1, start_column: 2, end_line: 3, end_column: 4) - assert(location1.include?(location2)) + assert_includes(location1, location2) location3 = Location.new("foo.rb", start_line: 1, start_column: 2, end_line: 3, end_column: 5) - refute(location1.include?(location3)) - assert(location3.include?(location1)) + refute_includes(location1, location3) + assert_includes(location3, location1) location4 = Location.new("foo.rb", start_line: 1, start_column: 2, end_line: 4, end_column: 4) - refute(location1.include?(location4)) - assert(location4.include?(location1)) + refute_includes(location1, location4) + assert_includes(location4, location1) location5 = Location.new("foo.rb", start_line: 1, start_column: 3, end_line: 3, end_column: 4) - assert(location1.include?(location5)) - refute(location5.include?(location1)) + assert_includes(location1, location5) + refute_includes(location5, location1) location6 = Location.new("foo.rb", start_line: 2, start_column: 2, end_line: 3, end_column: 4) - assert(location1.include?(location6)) - refute(location6.include?(location1)) + assert_includes(location1, location6) + refute_includes(location6, location1) location7 = Location.new("bar.rb", start_line: 1, start_column: 2, end_line: 3, end_column: 4) - refute(location1.include?(location7)) - refute(location7.include?(location1)) + refute_includes(location1, location7) + refute_includes(location7, location1) location8 = Location.new("foo.rb") location9 = Location.new("foo.rb") - assert(location8.include?(location9)) - assert(location9.include?(location8)) + assert_includes(location8, location9) + assert_includes(location9, location8) - assert(location8.include?(location1)) - refute(location1.include?(location8)) + assert_includes(location8, location1) + refute_includes(location1, location8) location10 = Location.new("foo.rb", start_line: 1, end_line: 3) - assert(location10.include?(location1)) - refute(location1.include?(location10)) + assert_includes(location10, location1) + refute_includes(location1, location10) end def test_comparison From 1cc54d8651f8182241780c39929828fa5cdbf3ed Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Wed, 13 May 2026 10:49:37 -0400 Subject: [PATCH 4/6] `bin/style -a --only=Minitest/AssertMatch` --- test/spoom/deadcode/index_references_test.rb | 2 +- test/spoom/model/references_visitor_test.rb | 2 +- test/spoom/sorbet/sigils_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/spoom/deadcode/index_references_test.rb b/test/spoom/deadcode/index_references_test.rb index c7342b7d..29c2b213 100644 --- a/test/spoom/deadcode/index_references_test.rb +++ b/test/spoom/deadcode/index_references_test.rb @@ -170,7 +170,7 @@ def foo(&block) when "[]", "!" next else - assert(ref.name =~ /^m(\d+)(=)?$/) + assert_match(/^m(\d+)(=)?$/, ref.name) end end end diff --git a/test/spoom/model/references_visitor_test.rb b/test/spoom/model/references_visitor_test.rb index 5090d61c..afaa06b0 100644 --- a/test/spoom/model/references_visitor_test.rb +++ b/test/spoom/model/references_visitor_test.rb @@ -167,7 +167,7 @@ def foo(&block) assert_equal(51, refs.size) # 49 + 2 (including `[]` and `!`) refs.each do |ref| - assert(ref =~ /^(m(\d+)(=)?)|\[\]|!$/) + assert_match(/^(m(\d+)(=)?)|\[\]|!$/, ref) end end diff --git a/test/spoom/sorbet/sigils_test.rb b/test/spoom/sorbet/sigils_test.rb index f076ea24..1972526f 100644 --- a/test/spoom/sorbet/sigils_test.rb +++ b/test/spoom/sorbet/sigils_test.rb @@ -120,7 +120,7 @@ class A; end new_content = Sigils.update_sigil(content, "true") - assert(/^# typed: ignore$/.match?(new_content)) + assert_match(/^# typed: ignore$/, new_content) strictness = Sigils.strictness_in_content(new_content) From 181882127751929a375edf16e48cbb3729273e78 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Wed, 13 May 2026 10:50:13 -0400 Subject: [PATCH 5/6] `bin/style -a --only=Minitest/AssertPredicate` --- test/.rubocop.yml | 4 ++++ test/spoom/context/git_test.rb | 4 ++-- test/spoom/context/sorbet_test.rb | 2 +- test/spoom/context_test.rb | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 test/.rubocop.yml diff --git a/test/.rubocop.yml b/test/.rubocop.yml new file mode 100644 index 00000000..59d5e09f --- /dev/null +++ b/test/.rubocop.yml @@ -0,0 +1,4 @@ +inherit_from: ../.rubocop.yml + +Minitest/AssertPredicate: + Enabled: true diff --git a/test/spoom/context/git_test.rb b/test/spoom/context/git_test.rb index 6ebc62a6..239302e4 100644 --- a/test/spoom/context/git_test.rb +++ b/test/spoom/context/git_test.rb @@ -105,7 +105,7 @@ def test_context_git_commit! res = context.git_commit! assert(res.status) - assert(context.git_workdir_clean?) + assert_predicate(context, :git_workdir_clean?) assert(context.file?("b")) context.destroy! @@ -242,7 +242,7 @@ def test_context_clean_workdir_on_clean_repo context.write!("file") context.git_commit! - assert(context.git_workdir_clean?) + assert_predicate(context, :git_workdir_clean?) context.destroy! end diff --git a/test/spoom/context/sorbet_test.rb b/test/spoom/context/sorbet_test.rb index 6c9cf89f..bea96bbb 100644 --- a/test/spoom/context/sorbet_test.rb +++ b/test/spoom/context/sorbet_test.rb @@ -177,7 +177,7 @@ def test_context_has_sorbet_config refute(context.has_sorbet_config?) context.write_sorbet_config!(".") - assert(context.has_sorbet_config?) + assert_predicate(context, :has_sorbet_config?) context.destroy! end diff --git a/test/spoom/context_test.rb b/test/spoom/context_test.rb index 0920ac2b..50916c1d 100644 --- a/test/spoom/context_test.rb +++ b/test/spoom/context_test.rb @@ -8,7 +8,7 @@ module Sorbet class ContextTest < Minitest::Test def test_context_mktmp! context = Context.mktmp! - assert(context.exist?) + assert_predicate(context, :exist?) context.destroy! end @@ -16,7 +16,7 @@ def test_context_make! context = Context.new("/tmp/spoom-context-test") refute(context.exist?) context.mkdir! - assert(context.exist?) + assert_predicate(context, :exist?) context.destroy! refute(context.exist?) end From ffb56e1304ea469e8b7e7506a0bde50c6bea1785 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Thu, 14 May 2026 13:03:50 -0400 Subject: [PATCH 6/6] `bin/style -a --only=Minitest/LiteralAsActualArgument` --- test/.rubocop.yml | 3 +++ test/spoom/context/git_test.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/.rubocop.yml b/test/.rubocop.yml index 59d5e09f..46a3e0c5 100644 --- a/test/.rubocop.yml +++ b/test/.rubocop.yml @@ -2,3 +2,6 @@ inherit_from: ../.rubocop.yml Minitest/AssertPredicate: Enabled: true + +Minitest/LiteralAsActualArgument: + Enabled: true diff --git a/test/spoom/context/git_test.rb b/test/spoom/context/git_test.rb index 239302e4..96359748 100644 --- a/test/spoom/context/git_test.rb +++ b/test/spoom/context/git_test.rb @@ -176,7 +176,7 @@ def test_context_git_last_commit assert(sha.size < 40) sha = T.must(context.git_last_commit(short_sha: false)).sha - assert_equal(sha.size, 40) + assert_equal(40, sha.size) last_commit = context.git_last_commit assert_equal(time.to_i, last_commit&.timestamp)