aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/hash_ext_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-11-14 09:08:40 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-11-14 09:08:40 +0000
commitb97ffa2a4fcb59de757745a71a6522662039e634 (patch)
treecd3d971e5551d4066bde957a4bf744fcfed1508a /activesupport/test/core_ext/hash_ext_test.rb
parent50ee332c4aa97aa797e814d3ab6ae63a0f8351e2 (diff)
downloadrails-b97ffa2a4fcb59de757745a71a6522662039e634.tar.gz
rails-b97ffa2a4fcb59de757745a71a6522662039e634.tar.bz2
rails-b97ffa2a4fcb59de757745a71a6522662039e634.zip
Hash#to_xml handles keys with the same name as Kernel methods. Closes #6613.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5521 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/hash_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 020e383c1a..3ede4893a5 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -458,4 +458,15 @@ class HashToXmlTest < Test::Unit::TestCase
hash_wia = hash.with_indifferent_access
assert_equal 3, hash_wia.default
end
+
+ # The XML builder seems to fail miserably when trying to tag something
+ # with the same name as a Kernel method (throw, test, loop, select ...)
+ def test_kernel_method_names_to_xml
+ hash = { :throw => { :ball => 'red' } }
+ expected = '<person><throw><ball>red</ball></throw></person>'
+
+ assert_nothing_raised do
+ assert_equal expected, hash.to_xml(@xml_options)
+ end
+ end
end