Created
July 6, 2016 00:17
-
-
Save JosephLeon/4a4b9f0240b00febf319515f5da5502c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_default_value_is_the_same_object | |
hash = Hash.new([]) | |
hash[:one] << "uno" | |
hash[:two] << "dos" | |
puts hash[:one] | |
assert_equal ["uno", "dos"], hash[:one] | |
assert_equal ["uno", "dos"], hash[:two] | |
assert_equal ["uno", "dos"], hash[:three] | |
assert_equal true, hash[:one].object_id == hash[:two].object_id | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment