pegomock

Pegomock is a powerful, yet simple mocking framework for the Go programming language

APACHE-2.0 License

Stars
254
Committers
24

Bot releases are visible (Hide)

pegomock - v4.1.0 Latest Release

Published by petergtz 4 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/petergtz/pegomock/compare/v4.0.0...v4.1.0

pegomock - v4.0.0

Published by petergtz over 1 year ago

Changes

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.

Migrating code from v3 to v4

Replace all matcher calls such as EqString(...) and EqInt(...) with the simpler Eq(...).

pegomock - v3.0.1

Published by petergtz over 1 year ago

Changes

  • Fix bug where generated files would have a wrong import name for the pegomock package
pegomock - v3.0.0

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:

  1. Change import paths as follows:
    -import "github.com/petergtz/pegomock"
    +import "github.com/petergtz/pegomock/v3"
    
  2. Install the latest pegomock binary via
    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"
pegomock - v2.9.0

Published by petergtz almost 4 years ago

Changes

pegomock - v2.8.0

Published by petergtz over 4 years ago

Changes

pegomock - v2.7.0

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!

pegomock - v2.6.0

Published by petergtz about 5 years ago

Changes

pegomock - v2.5.0

Published by petergtz over 5 years ago

Changes

  • Add support for recursively embedded interfaces.
pegomock - v2.4.0

Published by petergtz over 5 years ago

Changes

  • Add support for Go modules, i.e. pegomock can generate mocks in a directory outside of GOPATH (thanks, @MrCreosote)
pegomock - v2.3.0

Published by petergtz over 5 years ago

Changes

  • Allow channels with no direction as return value for callback stubs, even when return type has a direction.
pegomock - v2.2.0

Published by petergtz over 5 years ago

Changes

  • Make sure numbered import paths have a stable sort order between generate commands to avoid unnecessary diffs. Thanks @hferentschik for the PR.
pegomock - v2.1.0

Published by petergtz over 5 years ago

Changes

  • Introduce new CLI flag --mock-name to customize the generated mock name (Thanks @relnod)
  • Fix channel directions in generated mocks when using flag --use-experimental-model-gen (Thanks @lkysow)
  • Use stable Go version in Travis CI build instead of tip
pegomock - v2.0.3

Published by petergtz over 5 years ago

Changes

Undo package name determination through AST parsing

This is not covering certain use cases and needs more testing before it can be made available.

See also: https://github.com/petergtz/pegomock/issues/77

pegomock - v2.0.2

Published by petergtz over 5 years ago

Changes

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.

pegomock - v2.0.1

Published by petergtz over 5 years ago

Changes

  • Use goreleaser from now on to provide binaries along with releases
pegomock - v2.0.0

Published by petergtz almost 6 years ago

Changes

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.

pegomock - v1.0.0

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.