Skip to content

Commit

Permalink
working away
Browse files Browse the repository at this point in the history
  • Loading branch information
Danish Khan committed Mar 1, 2011
1 parent daea57a commit ab74af5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions koans/about_hashes.rb
Expand Up @@ -24,8 +24,8 @@ def test_changing_hashes
hash = { :one => "uno", :two => "dos" } hash = { :one => "uno", :two => "dos" }
hash[:one] = "eins" hash[:one] = "eins"


expected = { :one => __, :two => "dos" } expected = { :one => "eins", :two => "dos" }
assert_equal __, expected == hash assert_equal true, expected == hash


# Bonus Question: Why was "expected" broken out into a variable # Bonus Question: Why was "expected" broken out into a variable
# rather than used as a literal? # rather than used as a literal?
Expand All @@ -35,15 +35,15 @@ def test_hash_is_unordered
hash1 = { :one => "uno", :two => "dos" } hash1 = { :one => "uno", :two => "dos" }
hash2 = { :two => "dos", :one => "uno" } hash2 = { :two => "dos", :one => "uno" }


assert_equal __, hash1 == hash2 assert_equal true, hash1 == hash2
end end


def test_hash_keys def test_hash_keys
hash = { :one => "uno", :two => "dos" } hash = { :one => "uno", :two => "dos" }
assert_equal __, hash.keys.size assert_equal 2, hash.keys.size
assert_equal __, hash.keys.include?(:one) assert_equal true, hash.keys.include?(:one)
assert_equal __, hash.keys.include?(:two) assert_equal true, hash.keys.include?(:two)
assert_equal __, hash.keys.class assert_equal Array, hash.keys.class
end end


def test_hash_values def test_hash_values
Expand Down

0 comments on commit ab74af5

Please sign in to comment.