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

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

  1. require 'facets/string/shatter'
  2. require 'test/unit'
  3. class TC_String_Shatter < Test::Unit::TestCase
  4. def test_shatter
  5. s = "<p>This<b>is</b>a test.</p>"
  6. sh = s.shatter( /<.*?>/ )
  7. e = ["<p>", "This", "<b>", "is", "</b>", "a test.", "</p>"]
  8. assert_equal(e, sh)
  9. end
  10. end