aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/inflector_test.rb')
-rw-r--r--activesupport/test/inflector_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index 41b5f909bb..4523430ebe 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -65,6 +65,11 @@ class InflectorTest < Test::Unit::TestCase
"PrimarySpokesman" => "primary_spokesmen",
"NodeChild" => "node_children"
}
+
+ UnderscoreToHuman = {
+ "employee_salary" => "Employee salary",
+ "underground" => "Underground"
+ }
def test_pluralize
SingularToPlural.each do |singular, plural|
@@ -120,4 +125,10 @@ class InflectorTest < Test::Unit::TestCase
assert_equal(class_name, Inflector.classify(table_name))
end
end
+
+ def test_humanize
+ UnderscoreToHuman.each do |underscore, human|
+ assert_equal(human, Inflector.humanize(underscore))
+ end
+ end
end \ No newline at end of file