diff --git a/lib/spec/matchers/operator_matcher.rb b/lib/spec/matchers/operator_matcher.rb index fce0d49e..1e8b9862 100755 --- a/lib/spec/matchers/operator_matcher.rb +++ b/lib/spec/matchers/operator_matcher.rb @@ -21,7 +21,7 @@ def initialize(actual) def self.use_custom_matcher_or_delegate(operator) define_method(operator) do |expected| if matcher = OperatorMatcher.get(@actual.class, operator) - return @actual.send(matcher_method, matcher.new(expected)) + return @actual.send(::Spec::Matchers.last_should, matcher.new(expected)) else ::Spec::Matchers.last_matcher = self @operator, @expected = operator, expected @@ -45,10 +45,6 @@ def description end class PositiveOperatorMatcher < OperatorMatcher #:nodoc: - def matcher_method - :should - end - def __delegate_operator(actual, operator, expected) return true if actual.__send__(operator, expected) if ['==','===', '=~'].include?(operator) @@ -61,10 +57,6 @@ def __delegate_operator(actual, operator, expected) end class NegativeOperatorMatcher < OperatorMatcher #:nodoc: - def matcher_method - :should_not - end - def __delegate_operator(actual, operator, expected) return true unless actual.__send__(operator, expected) return fail_with_message("expected not: #{operator} #{expected.inspect},\n got: #{operator.gsub(/./, ' ')} #{actual.inspect}")