integration with gomega
Would love to have this so can have more expressive steps that don't need to reinvent the error logic.
https://github.com/onsi/gomega
I'm happy to work on this if you can give any pointers on where to start
Hi @charlierudolph nice to see you using go. regarding matchers, I will not add them as a hard dependency in godog it should be simple as it is, even if it is boring to check errors. Others prefer different libraries and godog should not advocate any and be based only on standard go ways.
Every godog step definition func must either return error or multi steps, you may combine any kind of matchers and nest them as long as they return an error. I think with some of the assertion libraries it is the right flow, but that should be simply an extension which you either prefer or not.
Do you have some specific ideas around integration?
if anyone else is looking for a way of integrating godog with gomega today, I've found the following to work quite well:
func shouldBeBar(foo string) (err error) {
defer func() {
if r := recover(); r != nil {
err = fmt.Errorf("%s", r)
}
}()
Expect(foo).Should(Equal("bar"))
return err
}
where the gomega fail handler is simply registered to panic
gomega.RegisterFailHandler(func(message string, _ ...int) {
panic(message)
})