module RuboCop::RSpec::Language::NodePattern

def block_or_numblock_pattern(string)

Deprecated:
  • Prefer using Node Pattern directly
def block_or_numblock_pattern(string)
  deprecation_warning __method__
  "{#{block_pattern(string)} #{numblock_pattern(string)}}"
end

def block_pattern(string)

Deprecated:
  • Prefer using Node Pattern directly
def block_pattern(string)
  deprecation_warning __method__
  "(block #{send_pattern(string)} ...)"
end

def deprecation_warning(method)

def deprecation_warning(method)
  # Only warn in derived extensions' specs
  return unless defined?(::RSpec)
  Kernel.warn <<~MESSAGE, uplevel: 2
    Usage of #{method} is deprecated. Use node pattern explicitly.
  MESSAGE
end

def numblock_pattern(string)

Deprecated:
  • Prefer using Node Pattern directly
def numblock_pattern(string)
  deprecation_warning __method__
  "(numblock #{send_pattern(string)} ...)"
end

def send_pattern(string)

Deprecated:
  • Prefer using Node Pattern directly
def send_pattern(string)
  deprecation_warning __method__
  "(send #rspec? #{string} ...)"
end