gsinclair/whitestone — Issue #3: Error message for Mt could be more helpful
Author: gsinclair
Created: 2012-02-26 01:15:18+00:00
State: open

Given the code

Mt tl1.description, /Overview of number systems/

I ran the test and got the error

Expect a String and a Regexp (any order)

The error is helpful if you genuinely misuse the Mt test, but in this case I _thought_ I was giving it a string and a regex. It must be that `tl1.description` is `nil`. So a more helpful error message would be

Expect a String and a Regexp (any order); got [nil, Regexp]

Another thing to consider is this: should Mt _accept_ `nil` and a regex, and _fail_ the test (because no match was found) rather than _error_ the test (because the wrong argument types were given)? This could be argued either way and requires further thought.