diff options
author | Sam Granieri <sam@samgranieri.com> | 2009-03-07 10:54:27 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-07 10:54:27 +0000 |
commit | 20d3892f46c553e8ca3d4e8d223a3bd92789556d (patch) | |
tree | 2d1924af8277eaf148995569a2a1635827273e18 /activesupport/test/inflector_test_cases.rb | |
parent | 7fb7b48a1f771e50896a82d749a70922a18afae7 (diff) | |
download | rails-20d3892f46c553e8ca3d4e8d223a3bd92789556d.tar.gz rails-20d3892f46c553e8ca3d4e8d223a3bd92789556d.tar.bz2 rails-20d3892f46c553e8ca3d4e8d223a3bd92789556d.zip |
Allow String#parameterize to accept a separator [#2157 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/test/inflector_test_cases.rb')
-rw-r--r-- | activesupport/test/inflector_test_cases.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb index b7ac467c37..584cbff3e7 100644 --- a/activesupport/test/inflector_test_cases.rb +++ b/activesupport/test/inflector_test_cases.rb @@ -154,6 +154,22 @@ module InflectorTestCases "Squeeze separators" => "squeeze-separators" } + StringToParameterizeWithNoSeparator = { + "Donald E. Knuth" => "donaldeknuth", + "Random text with *(bad)* characters" => "randomtextwithbadcharacters", + "Trailing bad characters!@#" => "trailingbadcharacters", + "!@#Leading bad characters" => "leadingbadcharacters", + "Squeeze separators" => "squeezeseparators" + } + + StringToParameterizeWithUnderscore = { + "Donald E. Knuth" => "donald_e_knuth", + "Random text with *(bad)* characters" => "random_text_with_bad_characters", + "Trailing bad characters!@#" => "trailing_bad_characters", + "!@#Leading bad characters" => "leading_bad_characters", + "Squeeze separators" => "squeeze_separators" + } + # Ruby 1.9 doesn't do Unicode normalization yet. if RUBY_VERSION >= '1.9' StringToParameterizedAndNormalized = { |