Sha256: d123cd6f3e37b87bca289d890cbe44dba42f9551dd7951ba22f6d8576d232136
Contents?: true
Size: 692 Bytes
Versions: 4
Compression:
Stored size: 692 Bytes
Contents
if defined?(Psych) && Psych.respond_to?(:dump) module Psych class << self def dump_with_mocks(object, *args) return dump_without_mocks(object, *args) unless object.instance_variable_defined?(:@mock_proxy) mp = object.instance_variable_get(:@mock_proxy) return dump_without_mocks(object, *args) unless mp.is_a?(::RSpec::Mocks::Proxy) object.send(:remove_instance_variable, :@mock_proxy) begin dump_without_mocks(object, *args) ensure object.instance_variable_set(:@mock_proxy,mp) end end alias_method :dump_without_mocks, :dump alias_method :dump, :dump_with_mocks end end end
Version data entries
4 entries across 4 versions & 1 rubygems