summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-06-24 16:37:50 +0800
committerGitHub <noreply@github.com>2016-06-24 16:37:50 +0800
commitc364faf80707f963a5f7e11b364563b5934fb265 (patch)
tree209e3f77b0c8123ff7842dea5ee8ad72aeb9cd5f /test
parent7b1201209a658e6e45aa3fc85b56dc8f61aa4fb1 (diff)
parentcbef14d4f18a56cbc9e1c7d9bcdbcf5dc6510a68 (diff)
downloadpsych-c364faf80707f963a5f7e11b364563b5934fb265.zip
Merge pull request #264 from tuexss/load_file-default
Add optional fallback return value parameter
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 7de9e07..508519b 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -144,6 +144,11 @@ class TestPsych < Psych::TestCase
}
end
+ def test_load_file_with_fallback
+ t = Tempfile.create(['empty', 'yml'])
+ assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+ end
+
def test_parse_file
Tempfile.create(['yikes', 'yml']) {|t|
t.binmode