From 3b603bbc937ec9647de78fd271347987aea24e09 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 2 Apr 2008 12:47:52 +0000 Subject: Revert [9209] Use Hash#except git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/hash_ext_test.rb | 32 ---------------------------- 1 file changed, 32 deletions(-) (limited to 'activesupport/test/core_ext') 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 -- cgit v1.2.3