add skip-ensure flag to avoid import cycle (#140)

For mocks generated outside of the tested package with tests lives inside the same package as the tested code (i.e. pkg_test not used) --skip-ensure suppresses import of the source pkg

https://github.com/matryer/moq/issues/139

fix typo in readme
This commit is contained in:
Umputun
2020-09-17 03:49:08 -05:00
committed by GitHub
parent a69ca93dec
commit be64288727
6 changed files with 73 additions and 34 deletions

View File

@@ -33,6 +33,9 @@ moq [flags] source-dir interface [interface2 [interface3 [...]]]
package name (default will infer)
-stub
return zero values when no mock implementation is provided, do not panic
-skip-ensure
suppress mock implementation check, avoid import cycle if mocks generated outside of the tested package
Specifying an alias for the mock is also supported with the format 'interface:alias'
Ex: moq -pkg different . MyInterface:MyMock
```