summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-30 00:10:31 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-30 00:10:31 +0000
commit0df90074c740c2c106051b44fcebaf36b103485b (patch)
treea9d4d69de81bafe49c1e5d6370b1b5c5f4a6cde2 /test/psych/test_parser.rb
parent302b6f6e0264dc7f03cfb1a55829ef60af1e96b0 (diff)
* 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.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"