Skip to content

Commit 40743b3

Browse files
getaaronhsbt
authored andcommitted
Add failing test for error on same key
1 parent 5ad72f8 commit 40743b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/psych/test_hash.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ def test_map
9292
assert_equal X, x.class
9393
end
9494

95+
def test_error_on_same_key
96+
assert_raises(Psych::Exception) do
97+
Psych.load <<-EOF
98+
-
99+
same_key: 'value'
100+
same_key: 'value'
101+
EOF
102+
end
103+
end
104+
95105
def test_self_referential
96106
@hash['self'] = @hash
97107
assert_cycle(@hash)

0 commit comments

Comments
 (0)