Created
January 7, 2011 17:59
-
-
Save carlosgaldino/769839 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Este é um exemplo encontrado na última edição do Programming Ruby do Dave Thomas, página 53. | |
# testa o método que converte uma string em um array de palavras | |
def test_empty_string | |
assert_equal([], words_from_string("")) | |
assert_equal([], words_from_string(" ")) | |
end | |
def test_single_word | |
assert_equal(["cat"], words_from_string("cat")) | |
assert_equal(["cat"], words_from_string(" cat ")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment