Closed AlexLuya closed 10 years ago
I think that's possible - and might be worth doing. Especially since it won't break old code (since testing.T will always satisfy this new interface)
Perhaps you feel like doing it and sending in a pull request? As long as all the tests pass, we'll know it works.
Mat
Sent from my iPhone
On 22 Nov 2013, at 21:04, Alex Luya notifications@github.com wrote:
I think the mocking style of testify is more nature than gomock,and hope it can be hooked into ginkgo(a BDD framework:https://github.com/onsi),so posted a function request here:onsi/ginkgo#17 the developer of ginkgo said:
It looks like testify uses (testing.T) directly instead of an interface (which gomock does). Ginkgo can provide such frameworks with a Fail function that one can wrap in such a way to satisfy most interfaces (this is how we support go mock), but testing.T refers to a concrete type and passing in the testing.T for the test that Ginkgo runs in would cause the entire suite to fail should one of your mock assertions fail...
His suggestion(or needing) is:replaces *testing.T with an interface first,so question:is it possible?.
— Reply to this email directly or view it on GitHub.
Done
I think the mocking style of testify is more nature than gomock,and hope it can be hooked into ginkgo(a BDD framework:https://github.com/onsi),so posted a function request here:https://github.com/onsi/ginkgo/issues/17,but the developer of ginkgo said:
It looks like testify uses (testing.T) directly instead of an interface (which gomock does). Ginkgo can provide such frameworks with a Fail function that one can wrap in such a way to satisfy most interfaces (this is how we support go mock), but testing.T refers to a concrete type and passing in the testing.T for the test that Ginkgo runs in would cause the entire suite to fail should one of your mock assertions fail...
His suggestion(or needing) is:replaces *testing.T with an interface first,so question:is it possible?.