Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 8ddbed720a
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (28 sloc) 0.756 kb
require 'rspec/mocks/extensions/marshal'
require 'rspec/mocks/extensions/psych' if defined?(::Psych)
module RSpec
module Mocks
# @private
module Serialization
# @private
def self.fix_for(object)
object.extend(YAML) if defined?(::YAML)
end
# @private
module YAML
# @private
def to_yaml(options = {})
return nil if defined?(::Psych) && options.respond_to?(:[]) && options[:nodump]
return super(options) unless instance_variable_defined?(:@mock_proxy)
mp = @mock_proxy
remove_instance_variable(:@mock_proxy)
begin
super(options)
ensure
@mock_proxy = mp
end
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.