Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message for Mt could be more helpful #3

Open
gsinclair opened this issue Feb 26, 2012 · 0 comments
Open

Error message for Mt could be more helpful #3

gsinclair opened this issue Feb 26, 2012 · 0 comments

Comments

@gsinclair
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant