/vendor/gems/facets-2.4.5/test/core/string/test_words.rb
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
- require 'facets/string/words.rb'
- require 'test/unit'
- class Test_String_Words < Test::Unit::TestCase
- def test_words_01
- x = "a b c\nd e"
- assert_equal( ['a','b','c','d','e'], x.words )
- end
- def test_words_02
- x = "ab cd\nef"
- assert_equal( ['ab','cd','ef'], x.words )
- end
- def test_words_03
- x = "ab cd \n ef-gh"
- assert_equal( ['ab','cd','ef-gh'], x.words )
- end
- #def test_word_filter
- # s = "this is a test"
- # n = s.word_filter{ |w| "#{w}1" }
- # assert_equal( 'this1 is1 a1 test1', n )
- #end
- #def test_word_filter!
- # s = "this is a test"
- # s.word_filter!{ |w| "#{w}1" }
- # assert_equal( 'this1 is1 a1 test1', s )
- #end
- end