From 3c73f44c7f779fe9eea823457c4f288aa21d3c32 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Mon, 22 Oct 2012 21:25:02 +0000 Subject: * ext/psych/parser.c: just get the constant defined in Ruby. * ext/psych/lib/psych/syntax_error.rb: Psych::SyntaxError now inherits from StandardError rather than SyntaxError. Thanks Eric Hodel! * test/psych/test_exception.rb: tests for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_exception.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') 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 -- cgit v1.2.3