Sha256: d5458c837ec6c88e99b97f484dda28cf8f42c6b927e6365b4fbd40283adbe7fb

Contents?: true

Size: 484 Bytes

Versions: 2

Compression:

Stored size: 484 Bytes

Contents

require 'psych/helper'

module Psych
  class TestHash < TestCase
    def setup
      super
      @hash = { :a => 'b' }
    end

    def test_self_referential
      @hash['self'] = @hash
      assert_cycle(@hash)
    end

    def test_cycles
      assert_cycle(@hash)
    end

    def test_ref_append
      hash = Psych.load(<<-eoyml)
---
foo: &foo
  hello: world
bar:
  <<: *foo
eoyml
      assert_equal({"foo"=>{"hello"=>"world"}, "bar"=>{"hello"=>"world"}}, hash)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
psych-1.1.1 test/psych/test_hash.rb
psych-1.1.0 test/psych/test_hash.rb