Sha256: b6c741022419b1c6580147d54a0f6bddef26c5fd84002f38121c056c426db661

Contents?: true

Size: 476 Bytes

Versions: 14

Compression:

Stored size: 476 Bytes

Contents

module RSpec
  module Mocks
    module Serialization
      def self.fix_for(object)
        object.extend(YAML) if defined?(::YAML)
      end

      module YAML
        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
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
rspec-mocks-2.0.1 lib/rspec/mocks/serialization.rb
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.4.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.4.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.3.2 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.3.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.3.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.2.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.1.2 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.1.1 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.1.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
gemrage-0.0.0 vendor/ruby/1.8/gems/rspec-mocks-2.0.0/lib/rspec/mocks/serialization.rb
rspec-mocks-2.0.0 lib/rspec/mocks/serialization.rb
rspec-mocks-2.0.0.rc lib/rspec/mocks/serialization.rb