Skip to content

Instantly share code, notes, and snippets.

@carlosgaldino
Created January 7, 2011 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosgaldino/769839 to your computer and use it in GitHub Desktop.
Save carlosgaldino/769839 to your computer and use it in GitHub Desktop.
# 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