mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-13 06:43:20 -04:00
Add test_default_value_attribute to about_hashes.rb
This commit is contained in:
@@ -113,4 +113,14 @@ class AboutHashes < Neo::Koan
|
||||
assert_equal __(["dos"]), hash[:two]
|
||||
assert_equal __([]), hash[:three]
|
||||
end
|
||||
|
||||
def test_default_value_attribute
|
||||
hash = Hash.new
|
||||
|
||||
assert_equal __(nil), hash[:some_key]
|
||||
|
||||
hash.default = 'peanut'
|
||||
|
||||
assert_equal __('peanut'), hash[:some_key]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user