gospec
gospec copied to clipboard
Make *testing.T object available from inside spec functions
I've hit a hiccup trying to use gomock w/ gospec b/c creating a gomock controller requires access to the testing object that go usually passes in to tests. Ideally there'd be a way to get access to the lower level testing object from within the spec functions, possibly as a method call on the context object.
+1. I might see if I can hack some code in that allows this and PR it.
I'd like this functionality as well. @orfjackal, any plans to merge this in? @rafrombrc, any plans to merge this in your fork?
@jveldridge No, I worked around it. Turned out I was able to appease gomock w/ a simple, fake testing context, see https://github.com/mozilla-services/heka/blob/dev/pipeline/testsupport/support.go#L36.
In other news, I haven't been very happy w/ gomock, wouldn't really recommend it for use.
Gotcha. I'm actually using testify (https://github.com/stretchr/testify/) having also been unhappy with gomock, but there's a similar issue. I'm likewise able to work around it, but seemed like this approach would be more elegant.