aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb10
1 files changed, 10 insertions, 0 deletions
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' }