Method: RSpec::Matchers#match
- Defined in:
- lib/rspec/matchers.rb
#match(expected) ⇒ Object Also known as: match_regex, an_object_matching, a_string_matching, matching
Note:
The match_regex
alias is deprecated and is not recommended for use.
It was added in 2.12.1 to facilitate its use from within custom
matchers (due to how the custom matcher DSL was evaluated in 2.x,
match
could not be used there), but is no longer needed in 3.x.
Given a Regexp
or String
, passes if actual.match(pattern)
Given an arbitrary nested data structure (e.g. arrays and hashes),
matches if expected === actual
|| actual == expected
for each
pair of elements.
697 698 699 |
# File 'lib/rspec/matchers.rb', line 697 def match(expected) BuiltIn::Match.new(expected) end |