diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-04-02 12:47:52 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-04-02 12:47:52 +0000 |
commit | 3b603bbc937ec9647de78fd271347987aea24e09 (patch) | |
tree | 093617bbe3cdf1b2338c88a23862ff556fd73198 /activesupport/test/core_ext | |
parent | adaed1ebcb4af2a7203d61e70b826f69f880fb2f (diff) | |
download | rails-3b603bbc937ec9647de78fd271347987aea24e09.tar.gz rails-3b603bbc937ec9647de78fd271347987aea24e09.tar.bz2 rails-3b603bbc937ec9647de78fd271347987aea24e09.zip |
Revert [9209] Use Hash#except
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 9d1d6ec33f..706e218abc 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -310,38 +310,6 @@ class HashExtTest < Test::Unit::TestCase assert_equal expected, original.except!(:c) assert_equal expected, original end - - def test_without - original = { :a => 'x', :b => 'y', :c => 10 } - expected = { :a => 'x' } - - # Should return a hash without the given keys. - assert_equal expected, original.without(:b, :c) - assert_not_equal expected, original - - # Should ignore non-existant keys. - assert_equal expected, original.without(:b, :c, :d) - - # Should replace the hash with the given keys taken away. - assert_equal expected, original.without!(:b, :c) - assert_equal expected, original - end - - def test_indifferent_without - original = { :a => 'x', :b => 'y', :c => 10 }.with_indifferent_access - expected = { :c => 10 }.with_indifferent_access - - [['a', 'b'], [:a, :b]].each do |keys| - # Should return a new hash without the given keys. - assert_equal expected, original.without(*keys), keys.inspect - assert_not_equal expected, original - - # Should replace the hash without the given keys. - copy = original.dup - assert_equal expected, copy.without!(*keys) - assert_equal expected, copy - end - end end class IWriteMyOwnXML |