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

Make *testing.T object available from inside spec functions #4

Open
rafrombrc opened this issue Oct 22, 2012 · 4 comments
Open

Make *testing.T object available from inside spec functions #4

rafrombrc opened this issue Oct 22, 2012 · 4 comments

Comments

@rafrombrc
Copy link

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.

@xyzjace
Copy link

xyzjace commented Nov 26, 2013

+1. I might see if I can hack some code in that allows this and PR it.

@jveldridge
Copy link

I'd like this functionality as well. @orfjackal, any plans to merge this in? @rafrombrc, any plans to merge this in your fork?

@rafrombrc
Copy link
Author

@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.

@jveldridge
Copy link

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.

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

3 participants