Module: RSpec::Mocks::Serialization::YAML
- Defined in:
- lib/rspec/mocks/serialization.rb
Instance Method Summary collapse
Instance Method Details
#to_yaml(options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rspec/mocks/serialization.rb', line 12 def to_yaml( = {}) return nil if defined?(::Psych) && .respond_to?(:[]) && [:nodump] return super() unless instance_variable_defined?(:@mock_proxy) mp = @mock_proxy remove_instance_variable(:@mock_proxy) begin super() ensure @mock_proxy = mp end end |