Skip to content

Commit 3334d7d

Browse files
authored
Merge pull request #15 from Interdictor/master
Add test_default_value_attribute to about_hashes.rb
2 parents 3bb8d5d + e647408 commit 3334d7d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/about_hashes.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,14 @@ def test_default_value_with_block
113113
assert_equal __(["dos"]), hash[:two]
114114
assert_equal __([]), hash[:three]
115115
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
116126
end

0 commit comments

Comments
 (0)