diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-09-10 19:06:59 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-09-10 19:06:59 +0100 |
commit | 6d1be5f1eb83fb693ffd00e1967c1b3ca1c9ece3 (patch) | |
tree | 059a4da48e9d4ec113c7df2bf915e83244ea3820 /activesupport/test | |
parent | d0a2b849f469469a1b189b4d077a95f35e31d65a (diff) | |
parent | c19c0e7872e65094b14bc08e24d19eebd9d1562a (diff) | |
download | rails-6d1be5f1eb83fb693ffd00e1967c1b3ca1c9ece3.tar.gz rails-6d1be5f1eb83fb693ffd00e1967c1b3ca1c9ece3.tar.bz2 rails-6d1be5f1eb83fb693ffd00e1967c1b3ca1c9ece3.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/inflector_test.rb | 6 | ||||
-rw-r--r-- | activesupport/test/inflector_test_cases.rb | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 8eebe1be25..f304844e82 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -98,6 +98,12 @@ class InflectorTest < Test::Unit::TestCase end end + def test_parameterize + StringToParameterized.each do |some_string, parameterized_string| + assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string)) + end + end + def test_classify ClassNameToTableName.each do |class_name, table_name| assert_equal(class_name, ActiveSupport::Inflector.classify(table_name)) diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb index a9dd83a389..d399c90385 100644 --- a/activesupport/test/inflector_test_cases.rb +++ b/activesupport/test/inflector_test_cases.rb @@ -142,6 +142,11 @@ module InflectorTestCases "NodeChild" => "node_children" } + StringToParameterized = { + "Donald E. Knuth" => "donald-e-knuth", + "Random text with *(bad)* characters" => "random-text-with-bad-characters" + } + UnderscoreToHuman = { "employee_salary" => "Employee salary", "employee_id" => "Employee", |