Sha256: a3e6c469e64ce487fc65518098fe86943069f3e3015ec027e11c2e1f522b2963

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

require 'muack/mock'

module Muack
  class Spy < Mock
    def initialize stub
      super(stub.object)
      @secret = stub.__mock_disps.values.flatten # steal disps
    end

    # used for Muack::Session#verify
    def __mock_verify
      @secret.each do |defi|
        __mock_dispatch(defi.msg, defi.args) if __mock_defis.key?(defi.msg)
      end
      super # simulate dispatching before passing to mock to verify
    end

    # used for Muack::Session#reset, but spies never leave any track
    def __mock_reset; end

    private
    def __mock_inject_method defi; end # spies don't leave any track
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
muack-1.1.0 lib/muack/spy.rb