Module: RuboCop::RSpec::TopLevelGroup

Overview

Helper methods for top level example group cops

Constant Summary

Constants included from Language

Language::ALL

Instance Method Summary collapse

Instance Method Details

#on_new_investigationObject


13
14
15
16
17
18
19
20
21
22
# File 'lib/rubocop/rspec/top_level_group.rb', line 13

def on_new_investigation
  super

  return unless root_node

  top_level_groups.each do |node|
    on_top_level_example_group(node) if example_group?(node)
    on_top_level_group(node)
  end
end

#top_level_groupsObject


24
25
26
27
# File 'lib/rubocop/rspec/top_level_group.rb', line 24

def top_level_groups
  @top_level_groups ||=
    top_level_nodes(root_node).select { |n| example_or_shared_group?(n) }
end