123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Expectations::PositiveExpectationHandler Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rspec-expectations/lib/rspec/expectations/handler.rb

Class Method Summary

Class Method Details

.handle_matcher(actual, initial_matcher, custom_message = nil, &block)

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 47

def self.handle_matcher(actual, initial_matcher, custom_message=nil, &block)
  ExpectationHelper.with_matcher(self, initial_matcher, custom_message) do |matcher|
    return ::RSpec::Matchers::BuiltIn::PositiveOperatorMatcher.new(actual) unless initial_matcher

    match_result = matcher.matches?(actual, &block)
    if custom_message && match_result.respond_to?(:error_generator)
      match_result.error_generator.opts[:message] = custom_message
    end

    match_result || ExpectationHelper.handle_failure(matcher, custom_message, :failure_message)
  end
end

.opposite_should_method

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 68

def self.opposite_should_method
  :should_not
end

.should_method

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 64

def self.should_method
  :should
end

.verb

[ GitHub ]

  
# File 'rspec-expectations/lib/rspec/expectations/handler.rb', line 60

def self.verb
  'is expected to'
end