Changeset 8878
- Timestamp:
- 02/16/08 00:02:30 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8877 r8878 1 1 *SVN* 2 3 * Add String#squish and String#squish! to remove consecutive chunks of whitespace. #11123 [jordi, Henrik N] 2 4 3 5 * Serialize BigDecimals as Floats when using to_yaml. #8746 [ernesto.jimenez] trunk/activesupport/lib/active_support/core_ext/string.rb
r8397 r8878 6 6 require 'active_support/core_ext/string/unicode' 7 7 require 'active_support/core_ext/string/xchar' 8 require 'active_support/core_ext/string/filters' 8 9 9 10 class String #:nodoc: 10 11 include ActiveSupport::CoreExtensions::String::Access 11 12 include ActiveSupport::CoreExtensions::String::Conversions 13 include ActiveSupport::CoreExtensions::String::Filters 12 14 include ActiveSupport::CoreExtensions::String::Inflections 13 15 if RUBY_VERSION < '1.9' trunk/activesupport/test/core_ext/string_ext_test.rb
r8789 r8878 169 169 end 170 170 171 def test_string_squish 172 original = %{ A string with tabs(\t\t), newlines(\n\n), and 173 many spaces( ). } 174 175 expected = "A string with tabs( ), newlines( ), and many spaces( )." 176 177 # Make sure squish returns what we expect: 178 assert_equal original.squish, expected 179 # But doesn't modify the original string: 180 assert_not_equal original, expected 181 182 # Make sure squish! returns what we expect: 183 assert_equal original.squish!, expected 184 # And changes the original string: 185 assert_equal original, expected 186 end 187 171 188 if RUBY_VERSION < '1.9' 172 189 def test_each_char_with_utf8_string_when_kcode_is_utf8