diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/inflector_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 0f398df8ff..cbf8250823 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -146,6 +146,16 @@ class InflectorTest < Test::Unit::TestCase "underground" => "Underground" } + MixtureToTitleCase = { + 'active_record' => 'Active Record', + 'ActiveRecord' => 'Active Record', + 'action web service' => 'Action Web Service', + 'Action Web Service' => 'Action Web Service', + 'Action web service' => 'Action Web Service', + 'actionwebservice' => 'Actionwebservice', + 'Actionwebservice' => 'Actionwebservice' + } + OrdinalNumbers = { "0" => "0th", "1" => "1st", @@ -196,6 +206,12 @@ class InflectorTest < Test::Unit::TestCase end end + MixtureToTitleCase.each do |before, title_cased| + define_method 'test_titlecase' do + assert_equal(title_cased, Inflector.titleize(before)) + end + end + def test_camelize CamelToUnderscore.each do |camel, underscore| assert_equal(camel, Inflector.camelize(underscore)) |