qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

Got an error when package name are different #41

Open ilovewchao opened 9 years ago

ilovewchao commented 9 years ago

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.

qur commented 9 years ago

Mocking the code under test is currently not supported.

ilovewchao commented 9 years ago

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