class RSpec::Mocks::MarshalExtension

def self.unpatch!

def self.unpatch!
  return unless Marshal.respond_to?(:dump_with_rspec_mocks)
  Marshal.instance_eval do
    class << self
      undef_method :dump_with_rspec_mocks
      undef_method :dump
      alias_method :dump, :dump_without_rspec_mocks
      undef_method :dump_without_rspec_mocks
    end
  end
end