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

Gomega really should not panic... #38

Open
onsi opened this issue Dec 6, 2013 · 0 comments
Open

Gomega really should not panic... #38

onsi opened this issue Dec 6, 2013 · 0 comments

Comments

@onsi
Copy link

onsi commented Dec 6, 2013

Gomega handles assertion failures exactly like Goblin's internal assertion library handles assertion failures: by calling a fail method that is provided to it (in Goblin's case it is g.fail which does not panic).

It would be incorrect for Gomega to panic because there is no way for the caller to rescue a panic emitted in a called go routine. This would make your asynchronous test example impossible:

  g.Describe("Numbers", func() {
      g.It("Should add two numbers asynchronously", func(done Done) {
          go func() {
              g.Assert(1+1).Equal(2) //If this line panics there's no way for the test framework to catch it!
              done()
          }()
      })
  })

Would you mind changing the language in the Readme to indicate that this really is not an open issue in Gomega any more? Thanks!

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

1 participant