module RuboCop::Cop::RSpec::AggregateExamples::NodeMatchers

@internal

Node matchers and searchers.

Private Instance Methods

contains_heredoc?(node) click to toggle source

Searches for HEREDOC in examples. It can be tricky to aggregate, especially when interleaved with parenthesis or curly braces.

# File lib/test_prof/cops/rspec/aggregate_examples/node_matchers.rb, line 57
def contains_heredoc?(node)
  node.each_descendant(:str, :xstr, :dstr).any?(&:heredoc?)
end
example_method?(method_name) click to toggle source
# File lib/test_prof/cops/rspec/aggregate_examples/node_matchers.rb, line 25
def example_method?(method_name)
  %i[it specify example scenario].include?(method_name)
end