Permalink
Browse files

Adds failed test case for slicing hash with indifferent access with s…

…ymbol keys

Signed-off-by: Michael Koziarski <michael@koziarski.com>
  • Loading branch information...
1 parent f10e60f commit 57e45ad328542906a895b05a8197342d4884e155 adam committed with NZKoz Sep 23, 2008
Showing with 10 additions and 0 deletions.
  1. +10 −0 activesupport/test/core_ext/hash_ext_test.rb
@@ -298,6 +298,16 @@ def test_indifferent_slice
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' }

0 comments on commit 57e45ad

Please sign in to comment.