diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-06 14:30:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-06 14:30:34 -0800 |
commit | 7aad593c5e6e37e5b5f218b51a91cc005d10a3ac (patch) | |
tree | 06a8c5ed0b26677fdeca0e71aee213a2768ce195 /test | |
parent | 9d431140d6159e97b964b623cfb4370ba0b8203d (diff) | |
download | psych-7aad593c5e6e37e5b5f218b51a91cc005d10a3ac.zip |
* 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.
Diffstat (limited to 'test')
-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 decb241..b607514 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" |