git://git.eng.unimelb.edu.au
/
ruby_koans.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f901791
)
hash keys and values must assert against sorted arrays - thanks gregmalcolm
author
Marc Peabody
<marc@theedgecase.com>
Thu, 8 Oct 2009 14:16:57 +0000
(10:16 -0400)
committer
Marc Peabody
<marc@theedgecase.com>
Thu, 8 Oct 2009 14:16:57 +0000
(10:16 -0400)
koans/about_hashes.rb
patch
|
blob
|
history
diff --git
a/koans/about_hashes.rb
b/koans/about_hashes.rb
index
634323a
..
e781896
100644
(file)
--- a/
koans/about_hashes.rb
+++ b/
koans/about_hashes.rb
@@
-38,16
+38,10
@@
class AboutHashes < EdgeCase::Koan
assert_equal hash1, hash2
end
- def test_hash_keys_and_values
+
def test_hash_keys_and_values
hash = { :one => "uno", :two => "dos" }
- assert_equal __, hash.keys.size
- assert_equal __, hash.has_key?(:one)
-
- # Why not just compare hash.keys to [:one, :two]?
- #
- # Clue: What was the name of the previous test again?
-
+ assert_equal __, hash.keys.sort
assert_equal __, hash.values.sort
end