Module: RuboCop::RSpec::Language::NodePattern

Included in:
Cop::RSpec::Base, Concept, RuboCop::RSpec::Language
Defined in:
lib/rubocop/rspec/language/node_pattern.rb

Overview

Helper methods to detect RSpec DSL used with send and block

Instance Method Summary collapse

Instance Method Details

#block_pattern(string) ⇒ Object


12
13
14
# File 'lib/rubocop/rspec/language/node_pattern.rb', line 12

def block_pattern(string)
  "(block #{send_pattern(string)} ...)"
end

#send_pattern(string) ⇒ Object


8
9
10
# File 'lib/rubocop/rspec/language/node_pattern.rb', line 8

def send_pattern(string)
  "(send #rspec? #{string} ...)"
end