withmock icon indicating copy to clipboard operation
withmock copied to clipboard

Got an error when package name are different

Open ilovewchao opened this issue 10 years ago • 2 comments

https://github.com/ilovewchao/withmock-test/tree/master/directory-issue

As the example form the link shows, we will get error message like this:

github.com/ilovewchao/withmock-test/directory-issue_test

./foo_test.go:15: undefined: foo.MOCK ./foo_test.go:19: bz.EXPECT undefined (type *foo.Baz has no field or method EXPECT) ./foo_test.go:34: undefined: apps ./foo_test.go:42: undefined: foo.MOCK

I used the "withmock go test", and the package name of the product code and the test code are different.

ilovewchao avatar Jul 22 '14 12:07 ilovewchao

Mocking the code under test is currently not supported.

qur avatar Jul 22 '14 14:07 qur

Can this be enabled by import the directory of code that is under test in the generated test file?

ilovewchao avatar Jul 23 '14 00:07 ilovewchao