Class: RSpec::Expectations::PositiveExpectationHandler
- Inherits:
-
ExpectationHandler
- Object
- ExpectationHandler
- RSpec::Expectations::PositiveExpectationHandler
- Defined in:
- lib/rspec/expectations/handler.rb
Class Method Summary collapse
Methods inherited from ExpectationHandler
check_message, message_must_be_string
Class Method Details
.handle_matcher(actual, matcher, message = nil, &block) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rspec/expectations/handler.rb', line 17 def self.handle_matcher(actual, matcher, =nil, &block) () ::RSpec::Matchers.last_should = :should ::RSpec::Matchers.last_matcher = matcher return ::RSpec::Matchers::BuiltIn::PositiveOperatorMatcher.new(actual) if matcher.nil? match = matcher.matches?(actual, &block) return match if match ||= matcher.respond_to?(:failure_message_for_should) ? matcher. : matcher. if matcher.respond_to?(:diffable?) && matcher.diffable? ::RSpec::Expectations.fail_with , matcher.expected, matcher.actual else ::RSpec::Expectations.fail_with end end |