diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/test_exception.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index c6d98d7a99..5615fc2db4 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -126,5 +126,26 @@ module Psych assert_equal 1, w.foo assert_nil w.bar end + + def test_psych_syntax_error + Tempfile.open(['parsefile', 'yml']) do |t| + t.binmode + t.write '--- `' + t.close + + begin + Psych.parse_file t.path + rescue StandardError + assert true # count assertion + ensure + return unless $! + + ancestors = $!.class.ancestors.inspect + + flunk "Psych::SyntaxError not rescued by StandardError: #{ancestors}" + end + end + end + end end |