module RSpec::Mocks::Serialization::YAML

def to_yaml(*a)

def to_yaml(*a)
  return super(*a) unless instance_variable_defined?(:@mock_proxy)
  mp = @mock_proxy
  remove_instance_variable(:@mock_proxy)
  begin
    super(*a)
  ensure
    @mock_proxy = mp
  end
end