class RSpec::Matchers::BuiltIn::Match

@api private Provides the implementation for `match`. Not intended to be instantiated directly.

Public Class Methods

new(expected) click to toggle source
# File lib/rspec/matchers/built_in/match.rb, line 8
def initialize(expected)
  super(expected)

  @expected_captures = nil
end

Public Instance Methods

description() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/match.rb, line 15
def description
  if @expected_captures && @expected.match(actual)
    "match #{surface_descriptions_in(expected).inspect} with captures #{surface_descriptions_in(@expected_captures).inspect}"
  else
    "match #{surface_descriptions_in(expected).inspect}"
  end
end
diffable?() click to toggle source

@api private @return [Boolean]

# File lib/rspec/matchers/built_in/match.rb, line 25
def diffable?
  true
end
with_captures(*captures) click to toggle source

Used to specify the captures we match against @return [self]

# File lib/rspec/matchers/built_in/match.rb, line 31
def with_captures(*captures)
  @expected_captures = captures
  self
end