/vendor/gems/facets-2.4.5/test/core/string/test_fold.rb
Ruby | 18 lines | 14 code | 4 blank | 0 comment | 0 complexity | 2d933179d060f3ea85b7acda3dedf8bd MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- require 'facets/string/fold.rb'
- require 'test/unit'
- class Test_String_Fold < Test::Unit::TestCase
- def test_fold_1
- s = "This is\na test.\n\nIt clumps\nlines of text."
- o = "This is a test.\n\nIt clumps lines of text."
- assert_equal( o, s.fold )
- end
- def test_fold_2
- s = "This is\na test.\n\n This is pre.\n Leave alone.\n\nIt clumps\nlines of text."
- o = "This is a test.\n\n This is pre.\n Leave alone.\n\nIt clumps lines of text."
- assert_equal( o, s.fold(true) )
- end
- end