diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-13 07:44:20 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-13 07:44:20 +0000 |
commit | 426fa08cc03b5dc65915a648c26a1b139314d54e (patch) | |
tree | bffa03bea26a612cb91779d98b701c6ee6f9ed0b /activesupport/test | |
parent | a65835968e55d6963bb3562f331a00c467e56d96 (diff) | |
download | rails-426fa08cc03b5dc65915a648c26a1b139314d54e.tar.gz rails-426fa08cc03b5dc65915a648c26a1b139314d54e.tar.bz2 rails-426fa08cc03b5dc65915a648c26a1b139314d54e.zip |
Fixed Inflector.underscore for use with acronyms, so HTML becomes html instead of htm_l #2173 [k@v2studio.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/inflector_test.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 620ae6f78e..0f398df8ff 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -109,7 +109,14 @@ class InflectorTest < Test::Unit::TestCase "Product" => "product", "SpecialGuest" => "special_guest", "ApplicationController" => "application_controller", - "Area51Controller" => "area51_controller" + "Area51Controller" => "area51_controller", + } + + CamelToUnderscoreWithoutReverse = { + "HTMLTidy" => "html_tidy", + "HTMLTidyGenerator" => "html_tidy_generator", + "FreeBSD" => "free_bsd", + "HTML" => "html", } CamelWithModuleToUnderscoreWithSlash = { @@ -199,9 +206,9 @@ class InflectorTest < Test::Unit::TestCase CamelToUnderscore.each do |camel, underscore| assert_equal(underscore, Inflector.underscore(camel)) end - - assert_equal "html_tidy", Inflector.underscore("HTMLTidy") - assert_equal "html_tidy_generator", Inflector.underscore("HTMLTidyGenerator") + CamelToUnderscoreWithoutReverse.each do |camel, underscore| + assert_equal(underscore, Inflector.underscore(camel)) + end end def test_camelize_with_module |