I
Ilya B.
Question about this method in Ruby Koans -> about_hashes.rb
def test_changing_hashes
hash = {
ne => "uno", :two => "dos" }
hash[
ne] = "eins"
expected = {
ne => "eins", :two => "dos" }
assert_equal true, expected == hash
# Bonus Question: Why was "expected" broken out into a variable
# rather than used as a literal?
end
Referring to the bonus question, is there any reason other than that
it's more readable this way? Seems to accomplish the same thing?
def test_changing_hashes
hash = {
hash[
expected = {
assert_equal true, expected == hash
# Bonus Question: Why was "expected" broken out into a variable
# rather than used as a literal?
end
Referring to the bonus question, is there any reason other than that
it's more readable this way? Seems to accomplish the same thing?