Sha256: b799d142fcad41523f4f5c6847cc36df9a498f80e94ff243dec056be663c64cd

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

require 'not_a_mock/matchers/call_matcher'

module NotAMock
  module Matchers
    # Matcher for
    #   object.should have_been_called
    class AnythingMatcher < CallMatcher
  
      def initialize(parent = nil)
        super parent
      end
  
      def matches_without_parents?
        @calls = CallRecorder.instance.calls_by_object(@object)
        !@calls.empty?
      end
  
      def failure_message_without_parents
        if matched?
          " was called"
        else
          " was never called"
        end
      end
  
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
not_a_mock-1.0.1 lib/not_a_mock/matchers/anything_matcher.rb
not_a_mock-1.0.0 lib/not_a_mock/matchers/anything_matcher.rb