@api private Provides the implementation for `match`. Not intended to be instantiated directly.
# File lib/rspec/matchers/built_in/match.rb, line 8 def initialize(expected) super(expected) @expected_captures = nil end
@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
@api private @return [Boolean]
# File lib/rspec/matchers/built_in/match.rb, line 25 def diffable? true end
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