module Marshal

Public Class Methods

dump(*args)
Also aliased as: dump_without_mocks
Alias for: dump_with_mocks
dump_with_mocks(*args) click to toggle source

@private

# File lib/spy/core_ext/marshal.rb, line 4
def dump_with_mocks(*args)
  object = args.shift
  spies = Spy::Subroutine.get_spies(object)
  if spies.empty?
    return dump_without_mocks(*args.unshift(object))
  end

  spy_hook_options = spies.map do |spy|
    [spy.hook_opts, spy.unhook]
  end

  begin
    dump_without_mocks(*args.unshift(object.dup))
  ensure
    spy_hook_options.each do |hook_opts, spy|
      spy.hook(hook_opts)
    end
  end
end
Also aliased as: dump
dump_without_mocks(*args)
Alias for: dump