Skip to content

Commit

Permalink
[test only] Make sure ActiveSupport plugin ignores class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
nvasilevski committed Jul 29, 2024
1 parent 6087731 commit 16a2e68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/spoom/deadcode/plugins/active_support_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ module Plugins
class ActiveSupportTest < TestWithProject
include Test::Helpers::DeadcodeHelper

def test_ignore_minitest_setup_and_teardown_with_symbols
def setup
@project.write!("test/foo_test.rb", <<~RB)
class FooTest
class FooTest < ActiveSupport::TestCase
setup(:alive1, :alive2)
teardown(:alive3)
Expand All @@ -22,14 +22,20 @@ def alive3; end
def dead; end
end
RB
end

def test_ignore_minitest_setup_and_teardown_with_symbols
index = index_with_plugins
assert_alive(index, "alive1")
assert_alive(index, "alive2")
assert_alive(index, "alive3")
assert_dead(index, "dead")
end

def test_ignore_test_class_definition
assert_ignored(index_with_plugins, "FooTest")
end

private

sig { returns(Index) }
Expand Down

0 comments on commit 16a2e68

Please sign in to comment.