From 8e3d26733b8eb05e09c52c4533db6c2cfe8b07eb Mon Sep 17 00:00:00 2001 From: brainopia Date: Sun, 18 Sep 2011 23:37:27 +0400 Subject: [PATCH] Fix test to reflect use of to_param for keys --- activesupport/test/core_ext/hash_ext_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb index 1813ba2a4d031..fa800eada242b 100644 --- a/activesupport/test/core_ext/hash_ext_test.rb +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -9,7 +9,7 @@ class HashExtTest < Test::Unit::TestCase class IndifferentHash < HashWithIndifferentAccess end - + class SubclassingArray < Array end @@ -272,14 +272,14 @@ def test_indifferent_hash_with_array_of_hashes hash = { "urls" => { "url" => [ { "address" => "1" }, { "address" => "2" } ] }}.with_indifferent_access assert_equal "1", hash[:urls][:url].first[:address] end - + def test_should_preserve_array_subclass_when_value_is_array array = SubclassingArray.new array << { "address" => "1" } hash = { "urls" => { "url" => array }}.with_indifferent_access assert_equal SubclassingArray, hash[:urls][:url].class end - + def test_should_preserve_array_class_when_hash_value_is_frozen_array array = SubclassingArray.new array << { "address" => "1" } @@ -543,7 +543,7 @@ def test_number_hash end def test_to_param_hash - assert_equal 'custom2=param2-1&custom=param-1', {ToParam.new('custom') => ToParam.new('param'), ToParam.new('custom2') => ToParam.new('param2')}.to_param + assert_equal 'custom-1=param-1&custom2-1=param2-1', {ToParam.new('custom') => ToParam.new('param'), ToParam.new('custom2') => ToParam.new('param2')}.to_param end def test_to_param_hash_escapes_its_keys_and_values @@ -955,13 +955,13 @@ def test_tag_with_attrs_and_whitespace hash = Hash.from_xml(xml) assert_equal "bacon is the best", hash['blog']['name'] end - + def test_empty_cdata_from_xml xml = "" - + assert_equal "", Hash.from_xml(xml)["data"] end - + def test_xsd_like_types_from_xml bacon_xml = <<-EOT @@ -1004,7 +1004,7 @@ def test_type_trickles_through_when_unknown assert_equal expected_product_hash, Hash.from_xml(product_xml)["product"] end - + def test_should_use_default_value_for_unknown_key hash_wia = HashWithIndifferentAccess.new(3) assert_equal 3, hash_wia[:new_key]