mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
parent
42328d4ef4
commit
e2f5e233b5
1 changed files with 13 additions and 0 deletions
|
@ -82,6 +82,19 @@ module Psych
|
|||
assert_equal 'omg!', ex.file
|
||||
end
|
||||
|
||||
def test_safe_load_stream_takes_file
|
||||
ex = assert_raise(Psych::SyntaxError) do
|
||||
Psych.safe_load_stream '--- `'
|
||||
end
|
||||
assert_nil ex.file
|
||||
assert_match '(<unknown>)', ex.message
|
||||
|
||||
ex = assert_raise(Psych::SyntaxError) do
|
||||
Psych.safe_load_stream '--- `', filename: 'omg!'
|
||||
end
|
||||
assert_equal 'omg!', ex.file
|
||||
end
|
||||
|
||||
def test_parse_file_exception
|
||||
Tempfile.create(['parsefile', 'yml']) {|t|
|
||||
t.binmode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue