diff options
author | David Lee <davidomundo@gmail.com> | 2011-06-03 16:07:28 -0700 |
---|---|---|
committer | David Lee <davidomundo@gmail.com> | 2011-06-11 01:35:16 -0700 |
commit | f3e8bb839428c1a3481284ebda4f998bfe68b171 (patch) | |
tree | baabdeb5c3c77b4409d0a855166eda3fceaf927c /activesupport | |
parent | 94df84a8a4b183037c160d513bf9fa9d1858c36f (diff) | |
download | rails-f3e8bb839428c1a3481284ebda4f998bfe68b171.tar.gz rails-f3e8bb839428c1a3481284ebda4f998bfe68b171.tar.bz2 rails-f3e8bb839428c1a3481284ebda4f998bfe68b171.zip |
Test retain delimiter in parameterization inflector
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/inflector_test.rb | 4 | ||||
-rw-r--r-- | activesupport/test/inflector_test_cases.rb | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 95f18126d4..0f1d12b7a3 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -148,8 +148,8 @@ class InflectorTest < Test::Unit::TestCase end def test_parameterize_with_custom_separator - StringToParameterized.each do |some_string, parameterized_string| - assert_equal(parameterized_string.gsub('-', '_'), ActiveSupport::Inflector.parameterize(some_string, '_')) + StringToParameterizeWithUnderscore.each do |some_string, parameterized_string| + assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string, '_')) end end diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb index ec9d92794c..391e402645 100644 --- a/activesupport/test/inflector_test_cases.rb +++ b/activesupport/test/inflector_test_cases.rb @@ -168,6 +168,7 @@ module InflectorTestCases StringToParameterizeWithNoSeparator = { "Donald E. Knuth" => "donaldeknuth", + "With-some-dashes" => "withsomedashes", "Random text with *(bad)* characters" => "randomtextwithbadcharacters", "Trailing bad characters!@#" => "trailingbadcharacters", "!@#Leading bad characters" => "leadingbadcharacters", @@ -179,6 +180,8 @@ module InflectorTestCases StringToParameterizeWithUnderscore = { "Donald E. Knuth" => "donald_e_knuth", "Random text with *(bad)* characters" => "random_text_with_bad_characters", + "With-some-dashes" => "with-some-dashes", + "Retain_underscore" => "retain_underscore", "Trailing bad characters!@#" => "trailing_bad_characters", "!@#Leading bad characters" => "leading_bad_characters", "Squeeze separators" => "squeeze_separators", |