From c452e49e763e3b7018f2cb550d318b2851703985 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 23 Sep 2008 11:57:57 +0200 Subject: Adds failed test case for slicing hash with indifferent access with symbol keys Signed-off-by: Michael Koziarski --- activesupport/test/core_ext/hash_ext_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport') diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 44d48e7577..9537f486cb 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -329,6 +329,16 @@ class HashExtTest < Test::Unit::TestCase end end + def test_indifferent_slice_access_with_symbols + original = {'login' => 'bender', 'password' => 'shiny', 'stuff' => 'foo'} + original = original.with_indifferent_access + + slice = original.slice(:login, :password) + + assert_equal 'bender', slice[:login] + assert_equal 'bender', slice['login'] + end + def test_except original = { :a => 'x', :b => 'y', :c => 10 } expected = { :a => 'x', :b => 'y' } -- cgit v1.2.3