Parent

Class Index [+]

Quicksearch

Spec::Expectations::PositiveExpectationHandler

Public Class Methods

handle_matcher(actual, matcher, message=nil, &block) click to toggle source
    # File lib/spec/expectations/handler.rb, line 6
 6:       def self.handle_matcher(actual, matcher, message=nil, &block)
 7:         ::Spec::Matchers.last_should = :should
 8:         ::Spec::Matchers.last_matcher = matcher
 9:         return ::Spec::Matchers::PositiveOperatorMatcher.new(actual) if matcher.nil?
10: 
11:         match = matcher.matches?(actual, &block)
12:         return match if match
13:         
14:         message ||= matcher.respond_to?(:failure_message_for_should) ?
15:                     matcher.failure_message_for_should :
16:                     matcher.failure_message
17:         
18:         if matcher.respond_to?(:diffable?) && matcher.diffable?
19:           ::Spec::Expectations.fail_with message, matcher.expected.first, matcher.actual
20:         else
21:           ::Spec::Expectations.fail_with message
22:         end
23:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.