diff options
author | Marcus Stollsteimer <sto.mar@web.de> | 2018-04-24 18:54:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-24 18:54:52 +0200 |
commit | 89bd0d453f6f4ff15414747dcdd8cfee698ca9bb (patch) | |
tree | d19b559e67c46b645893788fff2f5aa866a918d4 | |
parent | 9dd18ddc1845952303c32a74b2778da3c943ec0b (diff) | |
parent | e369254e8df8f8921d0827c5bfb953cc9b0cd7f0 (diff) | |
download | psych-89bd0d453f6f4ff15414747dcdd8cfee698ca9bb.tar.gz |
Merge pull request #357 from stomar/fallback-tests
Add more test cases for fallback of Psych.load_file
-rw-r--r-- | test/psych/test_psych.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index bce6bf8..8f9a100 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -156,6 +156,13 @@ class TestPsych < Psych::TestCase } end + def test_load_file_with_fallback_nil_or_false + Tempfile.create(['empty', 'yml']) {|t| + assert_nil Psych.load_file(t.path, fallback: nil) + assert_equal false, Psych.load_file(t.path, fallback: false) + } + end + def test_load_file_with_fallback_hash Tempfile.create(['empty', 'yml']) {|t| assert_equal Hash.new, Psych.load_file(t.path, fallback: Hash.new) |