summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcus Stollsteimer <sto.mar@web.de>2017-12-02 14:32:29 +0100
committerMarcus Stollsteimer <sto.mar@web.de>2017-12-02 14:32:29 +0100
commit5db58be1bfa1393dbf087d972465b61b3d6baa31 (patch)
tree3d5604e918b6fb355c124af11a8e81e2dc57ce67 /test
parentb620653700272dd71c22786f5042cd83bcfcfbc2 (diff)
downloadpsych-5db58be1bfa1393dbf087d972465b61b3d6baa31.zip
Convert fallback option to a keyword argument
Converting the optional fallback argument to a keyword argument fixes a problem that is caused by mixing optional arguments and optional keyword arguments. Without this change, a hash as fallback value is not handled correctly: in Psych.load("", nil, {}) the hash is not interpreted as the fallback value, and the default value for the fallback argument is used instead.
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 82906f0..2812fd1 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -146,7 +146,7 @@ class TestPsych < Psych::TestCase
def test_load_file_with_fallback
Tempfile.create(['empty', 'yml']) {|t|
- assert_equal Hash.new, Psych.load_file(t.path, Hash.new)
+ assert_equal Hash.new, Psych.load_file(t.path, fallback: Hash.new)
}
end