We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3bb8d5d + e647408 commit 3334d7dCopy full SHA for 3334d7d
1 file changed
src/about_hashes.rb
@@ -113,4 +113,14 @@ def test_default_value_with_block
113
assert_equal __(["dos"]), hash[:two]
114
assert_equal __([]), hash[:three]
115
end
116
+
117
+ def test_default_value_attribute
118
+ hash = Hash.new
119
120
+ assert_equal __(nil), hash[:some_key]
121
122
+ hash.default = 'peanut'
123
124
+ assert_equal __('peanut'), hash[:some_key]
125
+ end
126
0 commit comments