diff options
author | Sean Ouimet <sean@seanouimet.com> | 2008-05-05 10:03:11 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-05-05 10:03:11 -0500 |
commit | d75525b045b9f27ed108912a6dbdbad5ab775045 (patch) | |
tree | ed768c14c9df5e0ac0b1a2c99699c9cd6d777ef0 /activesupport/test | |
parent | a40223d36d4e90d520b09d51a3f2a7b3cd6c2f07 (diff) | |
download | rails-d75525b045b9f27ed108912a6dbdbad5ab775045.tar.gz rails-d75525b045b9f27ed108912a6dbdbad5ab775045.tar.bz2 rails-d75525b045b9f27ed108912a6dbdbad5ab775045.zip |
Added OrderedHash#delete [#113 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/ordered_options_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/ordered_options_test.rb b/activesupport/test/ordered_options_test.rb index 1a1d0c7648..3d537a0ae4 100644 --- a/activesupport/test/ordered_options_test.rb +++ b/activesupport/test/ordered_options_test.rb @@ -29,6 +29,19 @@ class OrderedHashTest < Test::Unit::TestCase assert_equal value, @ordered_hash.values.last assert_equal value, @ordered_hash[key] end + + def test_delete + key, value = 'white', 'ffffff' + bad_key = 'black' + + @ordered_hash[key] = value + assert_equal @keys.length + 1, @ordered_hash.length + + assert_equal value, @ordered_hash.delete(key) + assert_equal @keys.length, @ordered_hash.length + + assert_nil @ordered_hash.delete(bad_key) + end end class OrderedOptionsTest < Test::Unit::TestCase |