PageRenderTime 42ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/mediashelf/fedora-migrator
Ruby | 33 lines | 16 code | 7 blank | 10 comment | 0 complexity | 919754ea5f6117a82cf120e5d558dfdf MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/string/words.rb'
  2. require 'test/unit'
  3. class Test_String_Words < Test::Unit::TestCase
  4. def test_words_01
  5. x = "a b c\nd e"
  6. assert_equal( ['a','b','c','d','e'], x.words )
  7. end
  8. def test_words_02
  9. x = "ab cd\nef"
  10. assert_equal( ['ab','cd','ef'], x.words )
  11. end
  12. def test_words_03
  13. x = "ab cd \n ef-gh"
  14. assert_equal( ['ab','cd','ef-gh'], x.words )
  15. end
  16. #def test_word_filter
  17. # s = "this is a test"
  18. # n = s.word_filter{ |w| "#{w}1" }
  19. # assert_equal( 'this1 is1 a1 test1', n )
  20. #end
  21. #def test_word_filter!
  22. # s = "this is a test"
  23. # s.word_filter!{ |w| "#{w}1" }
  24. # assert_equal( 'this1 is1 a1 test1', s )
  25. #end
  26. end