Guest User

Untitled

a guest
Jul 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. # Este é um exemplo encontrado na última edição do Programming Ruby do Dave Thomas, página 53.
  2. # testa o método que converte uma string em um array de palavras
  3.  
  4. def test_empty_string
  5. assert_equal([], words_from_string(""))
  6. assert_equal([], words_from_string(" "))
  7. end
  8.  
  9. def test_single_word
  10. assert_equal(["cat"], words_from_string("cat"))
  11. assert_equal(["cat"], words_from_string(" cat "))
  12. end
Add Comment
Please, Sign In to add comment