diff --git a/lib/rubocop/cop/minitest/skip_ensure.rb b/lib/rubocop/cop/minitest/skip_ensure.rb index 9ff6bd2..af8b3bf 100644 --- a/lib/rubocop/cop/minitest/skip_ensure.rb +++ b/lib/rubocop/cop/minitest/skip_ensure.rb @@ -86,10 +86,10 @@ def use_skip_in_rescue?(skip_method) def valid_conditional_skip?(skip_method, ensure_node) if_node = skip_method.ancestors.detect(&:if_type?) - return false unless ensure_node.body.if_type? + return false unless ensure_node.branch.if_type? - match_keyword = ensure_node.body.if? ? if_node.if? : if_node.unless? - match_keyword && ensure_node.body.condition == if_node.condition + match_keyword = ensure_node.branch.if? ? if_node.if? : if_node.unless? + match_keyword && ensure_node.branch.condition == if_node.condition end end end diff --git a/rubocop-minitest.gemspec b/rubocop-minitest.gemspec index a609252..686823f 100644 --- a/rubocop-minitest.gemspec +++ b/rubocop-minitest.gemspec @@ -33,5 +33,5 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'rubocop', '>= 1.61', '< 2.0' - spec.add_dependency 'rubocop-ast', '>= 1.31.1', '< 2.0' + spec.add_dependency 'rubocop-ast', '>= 1.36.1', '< 2.0' end