Skip to content

Commit

Permalink
Replace EnsureNode.body with EnsureNode.branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvandersluis committed Nov 13, 2024
1 parent cd4cc5b commit 418053f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rubocop/cop/minitest/skip_ensure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rubocop-minitest.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 418053f

Please sign in to comment.