Skip to content

Commit

Permalink
Do not mark classes that inherit from ActiveJob::TestCase as dead
Browse files Browse the repository at this point in the history
  • Loading branch information
nvasilevski committed Jul 29, 2024
1 parent 6087731 commit 3e8ae20
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/spoom/deadcode/plugins/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Spoom
module Deadcode
module Plugins
class ActiveJob < Base
ignore_classes_inheriting_from("ActiveJob::TestCase")
ignore_classes_named("ApplicationJob")
ignore_methods_named("perform", "build_enumerator", "each_iteration")
end
Expand Down
9 changes: 9 additions & 0 deletions test/spoom/deadcode/plugins/active_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ def perform; end
)
end

def test_ignores_activejob_testcase_class_definition
@project.write!("test/foo_test.rb", <<~RB)
class FooTest < ActiveJob::TestCase
end
RB

assert_ignored(index_with_plugins, "FooTest")
end

private

sig { returns(Deadcode::Index) }
Expand Down

0 comments on commit 3e8ae20

Please sign in to comment.