From c2a60fec2f79c05bdb865c143b6ad8eddfc6cc36 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 14 Dec 2020 20:13:12 +0900 Subject: Merge Psych-3.2.1 from ruby/psych --- test/psych/test_exception.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/psych/test_exception.rb') 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 '--- `' -- cgit v1.2.3