Skip to content

Commit

Permalink
Add failing test for error on same key
Browse files Browse the repository at this point in the history
  • Loading branch information
getaaron authored and hsbt committed May 13, 2022
1 parent 5ad72f8 commit 40743b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/psych/test_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ def test_map
assert_equal X, x.class
end

def test_error_on_same_key
assert_raises(Psych::Exception) do
Psych.load <<-EOF
-
same_key: 'value'
same_key: 'value'
EOF
end
end

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

0 comments on commit 40743b3

Please sign in to comment.