diff options
author | Steve Purcell <steve@sanityinc.com> | 2008-06-03 14:15:33 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-03 14:15:33 -0500 |
commit | 7cfa6ec8a37b70ec302f09929df5160ac42971e7 (patch) | |
tree | 3ecd1a74837cba3c74513081ce35aff84fe8e74b /activesupport/test | |
parent | d54d90f2b590c763fe710482a9b993923fe03ec0 (diff) | |
download | rails-7cfa6ec8a37b70ec302f09929df5160ac42971e7.tar.gz rails-7cfa6ec8a37b70ec302f09929df5160ac42971e7.tar.bz2 rails-7cfa6ec8a37b70ec302f09929df5160ac42971e7.zip |
Add more standard Hash methods to ActiveSupport::OrderedHash [#314 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 14be48724e..98a6ad6b26 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -42,4 +42,23 @@ class OrderedHashTest < Test::Unit::TestCase assert_nil @ordered_hash.delete(bad_key) end + + def test_has_key + assert_equal true, @ordered_hash.has_key?('blue') + assert_equal true, @ordered_hash.key?('blue') + assert_equal true, @ordered_hash.include?('blue') + assert_equal true, @ordered_hash.member?('blue') + + assert_equal false, @ordered_hash.has_key?('indigo') + assert_equal false, @ordered_hash.key?('indigo') + assert_equal false, @ordered_hash.include?('indigo') + assert_equal false, @ordered_hash.member?('indigo') + end + + def test_has_value + assert_equal true, @ordered_hash.has_value?('000099') + assert_equal true, @ordered_hash.value?('000099') + assert_equal false, @ordered_hash.has_value?('ABCABC') + assert_equal false, @ordered_hash.value?('ABCABC') + end end |