Skip to content

Commit

Permalink
Address Rubocop warnings and CodeClimate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Jun 29, 2020
1 parent 0037e88 commit af294ae
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/rubocop/cop/rspec/let_setup.rb
Expand Up @@ -51,16 +51,11 @@ def unused_let_bang(node)
end

def child_let_bang(block_node)
return unless block_node.body
return unless block_node.body&.begin_type?

body = block_node.body

if body.begin_type?
body.each_child_node(:block) do |child|
if result = let_bang(child)
yield result
end
end
block_node.body.each_child_node(:block) do |child|
node_with_name = let_bang(child)
yield node_with_name if node_with_name
end
end
end
Expand Down

0 comments on commit af294ae

Please sign in to comment.