/vendor/gems/facets-2.4.5/test/core/string/test_fold.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 18 lines · 14 code · 4 blank · 0 comment · 0 complexity · 2d933179d060f3ea85b7acda3dedf8bd MD5 · raw file

  1. require 'facets/string/fold.rb'
  2. require 'test/unit'
  3. class Test_String_Fold < Test::Unit::TestCase
  4. def test_fold_1
  5. s = "This is\na test.\n\nIt clumps\nlines of text."
  6. o = "This is a test.\n\nIt clumps lines of text."
  7. assert_equal( o, s.fold )
  8. end
  9. def test_fold_2
  10. s = "This is\na test.\n\n This is pre.\n Leave alone.\n\nIt clumps\nlines of text."
  11. o = "This is a test.\n\n This is pre.\n Leave alone.\n\nIt clumps lines of text."
  12. assert_equal( o, s.fold(true) )
  13. end
  14. end