summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-22 21:25:02 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-22 21:25:02 +0000
commit3c73f44c7f779fe9eea823457c4f288aa21d3c32 (patch)
treedd8b7e9af8979d1738d10ecc4ddde5d5270a9638 /test/psych/test_exception.rb
parent6c6d4568e8b8c8667c0b57ca6e1b5ba5d7acbbe3 (diff)
downloadruby-3c73f44c7f779fe9eea823457c4f288aa21d3c32.tar.gz
* 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
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb21
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