method
use_custom_matcher_or_delegate
1.1.12 -
Show latest stable
- Class:
Spec::Matchers::OperatorMatcher
use_custom_matcher_or_delegate(operator)public
No documentation available.
# File lib/spec/matchers/operator_matcher.rb, line 23
def self.use_custom_matcher_or_delegate(operator)
define_method(operator) do |expected|
if matcher = OperatorMatcher.get(@actual.class, operator)
@actual.send(::Spec::Matchers.last_should, matcher.new(expected))
else
::Spec::Matchers.last_matcher = self
@operator, @expected = operator, expected
__delegate_operator(@actual, operator, expected)
end
end
end