Sha256: 22a8b6f608623b35c8901c54a85f68fd6b59399417dddbdedd0de27c6b02172d

Contents?: true

Size: 696 Bytes

Versions: 18

Compression:

Stored size: 696 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

18 entries across 16 versions & 4 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-mocks-2.8.0/lib/rspec/mocks/extensions/psych.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-mocks-2.8.0/lib/rspec/mocks/extensions/psych.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-mocks-2.8.0/lib/rspec/mocks/extensions/psych.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-mocks-2.8.0/lib/rspec/mocks/extensions/psych.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.8.0 lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.8.0.rc2 lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-mocks-2.7.0/lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.8.0.rc1 lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.7.0 lib/rspec/mocks/extensions/psych.rb
rspec-mocks-2.7.0.rc1 lib/rspec/mocks/extensions/psych.rb