diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 03:32:28 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-20 03:32:28 +0000 |
commit | 4e7c6f58fb14ad8783062303191eebed7699965b (patch) | |
tree | c88321c7d094d0419f4e7fb7b418b65b7e1fec64 /activesupport/test | |
parent | f49ba114dbb330c1865682c111a9ba372cb40bda (diff) | |
download | rails-4e7c6f58fb14ad8783062303191eebed7699965b.tar.gz rails-4e7c6f58fb14ad8783062303191eebed7699965b.tar.bz2 rails-4e7c6f58fb14ad8783062303191eebed7699965b.zip |
Added option to String#camelize to generate lower-cased camel case by passing in :lower, like "super_man".camelize(:lower) # => "superMan" [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3986 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/inflector_test.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 12976a6d92..c0a2b76a5a 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -110,7 +110,14 @@ class InflectorTest < Test::Unit::TestCase "Product" => "product", "SpecialGuest" => "special_guest", "ApplicationController" => "application_controller", - "Area51Controller" => "area51_controller", + "Area51Controller" => "area51_controller" + } + + UnderscoreToLowerCamel = { + "product" => "product", + "special_guest" => "specialGuest", + "application_controller" => "applicationController", + "area51_controller" => "area51Controller" } CamelToUnderscoreWithoutReverse = { @@ -308,4 +315,10 @@ class InflectorTest < Test::Unit::TestCase assert_equal(underscored, Inflector.underscore(Inflector.dasherize(underscored))) end end + + def test_underscore_to_lower_camel + UnderscoreToLowerCamel.each do |underscored, lower_camel| + assert_equal(lower_camel, Inflector.camelize(underscored, false)) + end + end end |