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

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

Overview

Deprecated.

Prefer using Node Pattern directly Use ‘’(block (send nil? #Example.all …) …)‘` instead of `block_pattern(’#Example.all’)‘

Helper methods to detect RSpec DSL used with send and block

Instance Method Summary collapse

Instance Method Details

#block_or_numblock_pattern(string) ⇒ Object

Deprecated.

Prefer using Node Pattern directly



30
31
32
33
# File 'lib/rubocop/rspec/language/node_pattern.rb', line 30

def block_or_numblock_pattern(string)
  deprecation_warning __method__
  "{#{block_pattern(string)} #{numblock_pattern(string)}}"
end

#block_pattern(string) ⇒ Object

Deprecated.

Prefer using Node Pattern directly



18
19
20
21
# File 'lib/rubocop/rspec/language/node_pattern.rb', line 18

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

#numblock_pattern(string) ⇒ Object

Deprecated.

Prefer using Node Pattern directly



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

def numblock_pattern(string)
  deprecation_warning __method__
  "(numblock #{send_pattern(string)} ...)"
end

#send_pattern(string) ⇒ Object

Deprecated.

Prefer using Node Pattern directly



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

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