summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-06 14:30:34 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-06 14:30:34 -0800
commit7aad593c5e6e37e5b5f218b51a91cc005d10a3ac (patch)
tree06a8c5ed0b26677fdeca0e71aee213a2768ce195 /test/psych/test_parser.rb
parent9d431140d6159e97b964b623cfb4370ba0b8203d (diff)
downloadpsych-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/psych/test_parser.rb')
-rw-r--r--test/psych/test_parser.rb7
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"