Sha256: 6cab91605acc4f26ad59cf215f7c5550d7597c68ea8bd20aa96f67662ad0b392

Contents?: true

Size: 697 Bytes

Versions: 145

Compression:

Stored size: 697 Bytes

Contents

if defined?(Psych) && Psych.respond_to?(:dump)
  module Psych
    class << self
      def dump_with_mocks(object, *args)
        return dump_without_mocks(object, *args) unless object.instance_variable_defined?(:@mock_proxy)

        mp = object.instance_variable_get(:@mock_proxy)
        return dump_without_mocks(object, *args) unless mp.is_a?(::RSpec::Mocks::Proxy)

        object.__send__(:remove_instance_variable, :@mock_proxy)

        begin
          dump_without_mocks(object, *args)
        ensure
          object.instance_variable_set(:@mock_proxy, mp)
        end
      end

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

Version data entries

145 entries across 94 versions & 18 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.5 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.4 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.3 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-mocks-2.13.0/lib/rspec/mocks/extensions/psych.rb
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/lib/rspec/mocks/extensions/psych.rb
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-mocks-2.11.3/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.2 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.1 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/psych.rb
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.9.0/lib/rspec/mocks/extensions/psych.rb
classiccms-0.7.0 vendor/bundle/gems/rspec-mocks-2.10.1/lib/rspec/mocks/extensions/psych.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/psych.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.13.1 lib/rspec/mocks/extensions/psych.rb