Skip to content

Commit e2953f5

Browse files
author
rito.ishihara
committed
Fix simplify guard clause in RSpec/ChangeByZero cop
Replace complex condition with a simpler guard clause
1 parent a02d20d commit e2953f5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/rubocop/cop/rspec/change_by_zero.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,7 @@ def on_send(node)
102102
private
103103

104104
def register_offense(node, change_node)
105-
if !node.parent.respond_to?(:send_type?) || !node.parent.send_type?
106-
return
107-
end
105+
return unless node.parent.send_type?
108106

109107
if compound_expectations?(node)
110108
add_offense(node,

0 commit comments

Comments
 (0)