lib/rubocop/rspec/node.rb in rubocop-rspec-2.29.1 vs lib/rubocop/rspec/node.rb in rubocop-rspec-2.29.2
- old
+ new
@@ -7,10 +7,10 @@
# In various cops we want to regard const as literal although it's not
# strictly literal.
def recursive_literal_or_const?
case type
when :begin, :pair, *AST::Node::COMPOSITE_LITERALS
- children.all?(&:recursive_literal_or_const?)
+ children.compact.all?(&:recursive_literal_or_const?)
else
literal? || const_type?
end
end
end