require 'test/unit' $:.unshift(File.dirname(__FILE__) + '/../lib') require 'string_extensions' class String include StringExtensions end class StringExtensionsTest < Test::Unit::TestCase def test_should_return_zero assert_equal 0, "".words assert_equal 0, " ".words assert_equal 0, " ".words end def test_should_have_valid_word_count assert_equal 1, 'Hello '.words assert_equal 2, 'Hello World!'.words assert_equal 2, 'Hello, World !!'.words end end