Class: Spec::Matchers::PositiveOperatorMatcher

Inherits:
BaseOperatorMatcher show all
Defined in:
lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from BaseOperatorMatcher

#generated_description

Instance Method Summary collapse

Methods inherited from BaseOperatorMatcher

#<, #<=, #==, #===, #=~, #>, #>=, #description, #fail_with_message, #initialize

Constructor Details

This class inherits a constructor from Spec::Matchers::BaseOperatorMatcher

Instance Method Details

#__delegate_method_missing_to_given(operator, expected) ⇒ Object



57
58
59
60
61
62
63
# File 'lib/gems/rspec-1.1.11/lib/spec/matchers/operator_matcher.rb', line 57

def __delegate_method_missing_to_given(operator, expected)
  @operator = operator
  ::Spec::Matchers.last_matcher = self
  return true if @given.__send__(operator, expected)
  return fail_with_message("expected: #{expected.inspect},\n     got: #{@given.inspect} (using #{operator})") if ['==','===', '=~'].include?(operator)
  return fail_with_message("expected: #{operator} #{expected.inspect},\n     got: #{operator.gsub(/./, ' ')} #{@given.inspect}")
end