lib/rubocop/rspec/top_level_group.rb in rubocop-rspec-1.43.0 vs lib/rubocop/rspec/top_level_group.rb in rubocop-rspec-1.43.1
- old
+ new
@@ -36,10 +36,12 @@
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
- if node.begin_type?
+ if node.nil?
+ []
+ elsif node.begin_type?
node.children
elsif node.module_type? || node.class_type?
top_level_nodes(node.body)
else
[node]