Bot releases are visible (Hide)
_ret1
, _result
and _params
not to conflict with method args by @krrrr38 in https://github.com/petergtz/pegomock/pull/124
Full Changelog: https://github.com/petergtz/pegomock/compare/v4.0.0...v4.1.0
Published by petergtz over 1 year ago
This release removes a lot of cruft from Pegomock. Reflection-based and sourced-based mock generation have been removed, because they don't support generics. The only and default method for mock generation is based on golang.org/x/tools/go/packages
.
It also removes a lot matchers and matcher code, that is not necessary anymore, now that matchers can use generics too.
The README was updated to document these changes.
Replace all matcher calls such as EqString(...)
and EqInt(...)
with the simpler Eq(...)
.
Published by petergtz over 1 year ago
Published by petergtz over 1 year ago
This release drops support for non-Go modules based setups. For those still requiring this support, it's recommended to stick with version 2.
There are no breaking API changes with the switch to v3. Migration from version 1 or 2 involves two steps:
-import "github.com/petergtz/pegomock"
+import "github.com/petergtz/pegomock/v3"
go install github.com/petergtz/pegomock/v3/pegomock@latest
For step 1, make sure to change sub-packages as follows:
-import "github.com/petergtz/pegomock/ginkgo_compatible"
+import "github.com/petergtz/pegomock/v3/ginkgo_compatible"
Published by petergtz almost 4 years ago
Published by petergtz over 4 years ago
Published by petergtz about 5 years ago
Sorry, this is basically a release with no changes, but I realized I had published 2.6.0 without having its commits on master and that seemed weird. However, I couldn't just fast-forward master, because it had already diverged. Hence, publishing this pseudo-release. Now everything should be in sync again. Yay!
Published by petergtz about 5 years ago
Published by petergtz over 5 years ago
Published by petergtz over 5 years ago
Published by petergtz over 5 years ago
Published by petergtz over 5 years ago
Published by petergtz over 5 years ago
--mock-name
to customize the generated mock name (Thanks @relnod)--use-experimental-model-gen
(Thanks @lkysow)Published by petergtz over 5 years ago
Undo package name determination through AST parsing
This is not covering certain use cases and needs more testing before it can be made available.
Published by petergtz over 5 years ago
This release fixes the package name generation by using a smarter algorithm. Specifically directories with dashes in the directory base names have bitten people more than once in the past (including me).
Here's how the new algorithm works: It first checks if there are already _test.go
files in the directory where the mock file is created and uses the test package name if possible. If no test files are present it looks for .go
files and uses their package name + _test
. If no .go
files exist at all in the directory, it uses the directory base name and converts potential -
s to _
s to make Go happy.
This algorithm is a bit slower than code used to be, but also more robust. If people see a problem with that, please open an issue. A workaround is to simply provide the package name via --package
. That will be very fast.
Published by petergtz over 5 years ago
Published by petergtz almost 6 years ago
This major release introduces non-global fail handlers. Check the documentation on how to set up the mocks. Also, please re-generate your mock files to make it compatible with this version of Pegomock.
Published by petergtz almost 6 years ago
Pegomock has been in use by several people and organizations, and has stabilized over the time. It seems to be the right time to mark the current version as 1.0.0.
Versioning will also make it possible to introduce changes that will require re-generating existing mocks and communicate such changes to users by bumping the major version number.