Sha256: c39c4e2ac9019ecea89f09a1b756148de1da011e7176b43f3178d25da78aa577
Contents?: true
Size: 640 Bytes
Versions: 16
Compression:
Stored size: 640 Bytes
Contents
module Marshal class << self # @private 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 alias_method :dump_without_mocks, :dump undef_method :dump alias_method :dump, :dump_with_mocks end end
Version data entries
16 entries across 16 versions & 1 rubygems