dojo-toulouse / elixir-koans

Small exercises to discover elixir by testing
249 stars 61 forks source link

The assertion choice for string 'at' and 'slice' examples is wrong #33

Closed gregmalcolm closed 8 years ago

gregmalcolm commented 8 years ago

I was getting strange results working on the koans for String.at and String.slice until I reexamined what you taught me in about_testing and realized that testing this way would not work. Because the 2nd argument of assert is an error message to display to the user.

So changing , __? will just change out the error message. With == __? the right hand side values are properly compared to the expectations.

In the case of assert String.at(a_string, 20), __? changing out the __? will just cause syntax errors because the assertion result is nil.

Loving these koans so far by the way!

apieum commented 8 years ago

hehe thanks. :)