summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-14 20:13:12 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-14 20:13:12 +0900
commitc2a60fec2f79c05bdb865c143b6ad8eddfc6cc36 (patch)
tree5ccf2881ca3f82ecc787a676e170476fd0a2bbcd /test/psych/test_exception.rb
parent27520a1e1e8ac1ef0607a75d654e2cff6d36e15a (diff)
Merge Psych-3.2.1 from ruby/psych
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r--test/psych/test_exception.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb
index e355c2692d..78601d09c7 100644
--- a/test/psych/test_exception.rb
+++ b/test/psych/test_exception.rb
@@ -118,6 +118,18 @@ module Psych
}
end
+ def test_safe_load_file_exception
+ Tempfile.create(['loadfile', 'yml']) {|t|
+ t.binmode
+ t.write '--- `'
+ t.close
+ ex = assert_raises(Psych::SyntaxError) do
+ Psych.safe_load_file t.path
+ end
+ assert_equal t.path, ex.file
+ }
+ end
+
def test_psych_parse_takes_file
ex = assert_raises(Psych::SyntaxError) do
Psych.parse '--- `'