diff options
author | Rishi Jain <rishi@joshsoftware.com> | 2014-11-06 06:34:56 +0530 |
---|---|---|
committer | Rishi Jain <rishi@joshsoftware.com> | 2014-11-06 13:04:56 +0530 |
commit | 54a9653a04f43917eab0b323ef4ba5b1fc6c05f4 (patch) | |
tree | 5ad61c1e82a940767077f15b3af1034ac5df9793 /activesupport/test | |
parent | 75099a933d0bf5e037037f78fbb305520955b064 (diff) | |
download | rails-54a9653a04f43917eab0b323ef4ba5b1fc6c05f4.tar.gz rails-54a9653a04f43917eab0b323ef4ba5b1fc6c05f4.tar.bz2 rails-54a9653a04f43917eab0b323ef4ba5b1fc6c05f4.zip |
added example of squish!, remove, test case for multiple occurrence of
pattern removal
added example for string#remove and test case for remove of multiple occurence of pattern
removed extra whitespaces
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/string_ext_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 119e62369d..e32c178951 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -266,6 +266,12 @@ class StringInflectionsTest < ActiveSupport::TestCase assert_equal "This is a good day to die", original end + def test_remove_for_multiple_occurrences + original = "This is a good day to die to die" + assert_equal "This is a good day", original.remove(" to die") + assert_equal "This is a good day to die to die", original + end + def test_remove! original = "This is a very good day to die" assert_equal "This is a good day to die", original.remove!(" very") |