test/psych/test_hash.rb in psych-2.0.11 vs test/psych/test_hash.rb in psych-2.0.12
- old
+ new
@@ -21,9 +21,16 @@
def setup
super
@hash = { :a => 'b' }
end
+ def test_referenced_hash_with_ivar
+ a = [1,2,3,4,5]
+ t1 = [HashWithCustomInit.new(a)]
+ t1 << t1.first
+ assert_cycle t1
+ end
+
def test_custom_initialized
a = [1,2,3,4,5]
t1 = HashWithCustomInit.new(a)
t2 = Psych.load(Psych.dump(t1))
assert_equal t1, t2