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.
I was getting strange results working on the koans for
String.at
andString.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!