From 54a9653a04f43917eab0b323ef4ba5b1fc6c05f4 Mon Sep 17 00:00:00 2001 From: Rishi Jain Date: Thu, 6 Nov 2014 06:34:56 +0530 Subject: 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 --- activesupport/test/core_ext/string_ext_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/test') 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") -- cgit v1.2.3