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/core_ext | |
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/core_ext')
-rw-r--r-- | activesupport/test/core_ext/string_ext_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index e232bf8384..6c9b7e7236 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -77,6 +77,24 @@ class StringInflectionsTest < Test::Unit::TestCase end end + def test_string_parameterized_normal + StringToParameterized.each do |normal, slugged| + assert_equal(normal.parameterize, slugged) + end + end + + def test_string_parameterized_no_separator + StringToParameterizeWithNoSeparator.each do |normal, slugged| + assert_equal(normal.parameterize(''), slugged) + end + end + + def test_string_parameterized_underscore + StringToParameterizeWithUnderscore.each do |normal, slugged| + assert_equal(normal.parameterize('_'), slugged) + end + end + def test_humanize UnderscoreToHuman.each do |underscore, human| assert_equal(human, underscore.humanize) |