go-json-rest icon indicating copy to clipboard operation
go-json-rest copied to clipboard

Update test utils to use an interface instead of *testing.T

Open bt opened this issue 8 years ago • 0 comments

I'm using Ginkgo as a testing framework and I noticed that it doesn't directly plug into Ginkgo because Ginkgo will not directly expose the *testing.T in it's tests.

By using an interface, TestReporter (similar to how gomock works), we can then leverage GinkgoT() with the test.RunReporter function, like such:

test.RunRequest(GinkgoT(), api.MakeHandler(), test.MakeSimpleRequest("GET", "/version", nil))

bt avatar Apr 23 '17 05:04 bt