diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 00:10:31 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 00:10:31 +0000 |
commit | 0df90074c740c2c106051b44fcebaf36b103485b (patch) | |
tree | a9d4d69de81bafe49c1e5d6370b1b5c5f4a6cde2 /test/psych/test_parser.rb | |
parent | 302b6f6e0264dc7f03cfb1a55829ef60af1e96b0 (diff) | |
download | ruby-0df90074c740c2c106051b44fcebaf36b103485b.tar.gz |
* ext/psych/parser.c (parse): parse method can take an option file
name for use in exception messages.
* test/psych/test_parser.rb: corresponding tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r-- | test/psych/test_parser.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb index decb241d19..b607514fe6 100644 --- a/test/psych/test_parser.rb +++ b/test/psych/test_parser.rb @@ -32,6 +32,13 @@ module Psych @handler.parser = @parser end + def test_filename + ex = assert_raises(Psych::SyntaxError) do + @parser.parse '--- `', 'omg!' + end + assert_match 'omg!', ex.message + end + def test_line_numbers assert_equal 0, @parser.mark.line @parser.parse "---\n- hello\n- world" |