diff options
| author | adam <adam@3scale.net> | 2008-09-23 11:57:57 +0200 | 
|---|---|---|
| committer | Michael Koziarski <michael@koziarski.com> | 2008-09-23 14:04:13 +0200 | 
| commit | c452e49e763e3b7018f2cb550d318b2851703985 (patch) | |
| tree | 36a22e84ca89672c3236ca49ff120c5c1ce123ec | |
| parent | a4f2ba8fb3c46ef9f7e31725849efdcb1a22c72d (diff) | |
| download | rails-c452e49e763e3b7018f2cb550d318b2851703985.tar.gz rails-c452e49e763e3b7018f2cb550d318b2851703985.tar.bz2 rails-c452e49e763e3b7018f2cb550d318b2851703985.zip | |
Adds failed test case for slicing hash with indifferent access with symbol keys
Signed-off-by: Michael Koziarski <michael@koziarski.com>
| -rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 10 | 
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' } | 
