diff options
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 |