Class: Micronaut::Matchers::PositiveOperatorMatcher

Inherits:
OperatorMatcher show all
Defined in:
lib/micronaut/matchers/operator_matcher.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from OperatorMatcher

#description, #fail_with_message, #initialize

Constructor Details

This class inherits a constructor from Micronaut::Matchers::OperatorMatcher

Instance Method Details

#__delegate_operator(actual, operator, expected) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/micronaut/matchers/operator_matcher.rb', line 29

def __delegate_operator(actual, operator, expected)
  return true if actual.__send__(operator, expected)
  if ['==','===', '=~'].include?(operator)
    fail_with_message("expected: #{expected.inspect},\n     got: #{actual.inspect} (using #{operator})") 
  else
    fail_with_message("expected: #{operator} #{expected.inspect},\n     got: #{operator.gsub(/./, ' ')} #{actual.inspect}")
  end
end