Class: RuboCop::RSpec::ExampleGroup
- Defined in:
- lib/rubocop/rspec/example_group.rb
Overview
Wrapper for RSpec example groups
Constant Summary
Constants included from Language
Language::ALL, Language::RSPEC
Instance Method Summary collapse
- #examples ⇒ Object
- #hooks ⇒ Object
-
#scope_change?(node) ⇒ Object
Detect if the node is an example group or shared example.
- #subjects ⇒ Object
Methods inherited from Concept
#eql?, #hash, #initialize, #to_node
Constructor Details
This class inherits a constructor from RuboCop::RSpec::Concept
Instance Method Details
#examples ⇒ Object
21 22 23 |
# File 'lib/rubocop/rspec/example_group.rb', line 21 def examples examples_in_scope(node).map(&Example.public_method(:new)) end |
#hooks ⇒ Object
25 26 27 |
# File 'lib/rubocop/rspec/example_group.rb', line 25 def hooks hooks_in_scope(node).map(&Hook.public_method(:new)) end |
#scope_change?(node) ⇒ Object
Detect if the node is an example group or shared example
Selectors which indicate that we should stop searching
13 14 15 |
# File 'lib/rubocop/rspec/example_group.rb', line 13 def_node_matcher :scope_change?, ( ExampleGroups::ALL + SharedGroups::ALL + Includes::ALL ).block_pattern |
#subjects ⇒ Object
17 18 19 |
# File 'lib/rubocop/rspec/example_group.rb', line 17 def subjects subjects_in_scope(node) end |