lib/rubocop/cop/mixin/minitest_exploration_helpers.rb in rubocop-minitest-0.12.0 vs lib/rubocop/cop/mixin/minitest_exploration_helpers.rb in rubocop-minitest-0.12.1

- old
+ new

@@ -42,12 +42,11 @@ class_ancestor = node.each_ancestor(:class).first test_class?(class_ancestor) end def test_cases(class_node) - (class_def_nodes(class_node).select { |def_node| test_case_name?(def_node.method_name) }) + - test_method_calls(class_node) + class_def_nodes(class_node).select { |def_node| test_case_name?(def_node.method_name) } end def lifecycle_hooks(class_node) class_def_nodes(class_node) .select { |def_node| lifecycle_hook_method?(def_node) } @@ -60,15 +59,9 @@ if class_def.def_type? [class_def] else class_def.each_child_node(:def).to_a end - end - - # support https://api.rubyonrails.org/classes/ActiveSupport/Testing/Declarative.html - def test_method_calls(class_node) - block_nodes = class_node.each_descendant(:block) - block_nodes.select { |block_node| block_node.method?(:test) } end def test_case_name?(name) name.to_s.start_with?('test_') end