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

"To err is human, to purr feline" - t.throws(petDog('dachshund')) wrongly suggests providing function call result (rather than function) as argument #5

Closed
sneakertack opened this issue Apr 9, 2015 · 1 comment

Comments

@sneakertack
Copy link

The provided example t.throws(petDog('dachshund')) can lead the student to wrongly conclude that analogous solution for feedCat is t.throws(feedCat('chocolate')) - which fails because throws wants a function to call, not the value/error from an already called function.

Suggest amending example to:

t.throws(function () {
  petDog('dachshund');
})

Or alternatively, using petDog.bind, like feedCat.bind in the solution.

@finnp finnp closed this as completed in ae4b9b8 Apr 9, 2015
@finnp
Copy link
Collaborator

finnp commented Apr 9, 2015

Thanks! I fixed that in 1.1.1 with both your version and the .bind version explained.

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

No branches or pull requests

2 participants