Sha256: f62b57f939af34b6f97f0a3055e23850e20e61331ec6b6a9daa7509ca4eebf04

Contents?: true

Size: 552 Bytes

Versions: 38

Compression:

Stored size: 552 Bytes

Contents

module Marshal
  class << self
    # Duplicates any mock objects before serialization. Otherwise,
    # serialization will fail because methods exist on the singleton class.
    def dump_with_mocks(object, *rest)
      if ::RSpec::Mocks.space.nil? || !::RSpec::Mocks.space.registered?(object) || NilClass === object
        dump_without_mocks(object, *rest)
      else
        dump_without_mocks(object.dup, *rest)
      end
    end

    alias_method :dump_without_mocks, :dump
    undef_method :dump
    alias_method :dump, :dump_with_mocks
  end
end

Version data entries

38 entries across 38 versions & 10 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
opal-rspec-cj-0.4.4 vendor_lib/rspec/mocks/extensions/marshal.rb
opal-rspec-0.4.3 vendor_lib/rspec/mocks/extensions/marshal.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-mocks-2.14.6/lib/rspec/mocks/extensions/marshal.rb
opal-rspec-0.4.2 vendor_lib/rspec/mocks/extensions/marshal.rb
opal-rspec-0.4.1 vendor_lib/rspec/mocks/extensions/marshal.rb
opal-rspec-0.4.0 vendor_lib/rspec/mocks/extensions/marshal.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/mocks/extensions/marshal.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-mocks-2.14.4/lib/rspec/mocks/extensions/marshal.rb
rspec-mocks-2.14.6 lib/rspec/mocks/extensions/marshal.rb
rspec-mocks-2.99.0.beta2 lib/rspec/mocks/extensions/marshal.rb
rspec-mocks-2.14.5 lib/rspec/mocks/extensions/marshal.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-mocks-2.14.4/lib/rspec/mocks/extensions/marshal.rb