diff --git a/mocks/cmd/stackTracer.go b/mocks/cmd/stackTracer.go index fe18ef1b..5343f97f 100644 --- a/mocks/cmd/stackTracer.go +++ b/mocks/cmd/stackTracer.go @@ -5,6 +5,8 @@ package mocks import ( errors "github.com/pkg/errors" mock "github.com/stretchr/testify/mock" + + testing "testing" ) // stackTracer is an autogenerated mock type for the stackTracer type @@ -27,3 +29,12 @@ func (_m *stackTracer) StackTrace() errors.StackTrace { return r0 } + +// newStackTracer creates a new instance of stackTracer. It also registers a cleanup function to assert the mocks expectations. +func newStackTracer(t testing.TB) *stackTracer { + mock := &stackTracer{} + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/pkg/Cleanup.go b/mocks/pkg/Cleanup.go index cb05eef6..45733d14 100644 --- a/mocks/pkg/Cleanup.go +++ b/mocks/pkg/Cleanup.go @@ -2,7 +2,11 @@ package mocks -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" + + testing "testing" +) // Cleanup is an autogenerated mock type for the Cleanup type type Cleanup struct { @@ -22,3 +26,12 @@ func (_m *Cleanup) Execute() error { return r0 } + +// NewCleanup creates a new instance of Cleanup. It also registers a cleanup function to assert the mocks expectations. +func NewCleanup(t testing.TB) *Cleanup { + mock := &Cleanup{} + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/pkg/OutputStreamProvider.go b/mocks/pkg/OutputStreamProvider.go index f4f34bd3..ff3b7c80 100644 --- a/mocks/pkg/OutputStreamProvider.go +++ b/mocks/pkg/OutputStreamProvider.go @@ -9,6 +9,8 @@ import ( mock "github.com/stretchr/testify/mock" pkg "github.com/vektra/mockery/v2/pkg" + + testing "testing" ) // OutputStreamProvider is an autogenerated mock type for the OutputStreamProvider type @@ -47,3 +49,12 @@ func (_m *OutputStreamProvider) GetWriter(_a0 context.Context, _a1 *pkg.Interfac return r0, r1, r2 } + +// NewOutputStreamProvider creates a new instance of OutputStreamProvider. It also registers a cleanup function to assert the mocks expectations. +func NewOutputStreamProvider(t testing.TB) *OutputStreamProvider { + mock := &OutputStreamProvider{} + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/pkg/WalkerVisitor.go b/mocks/pkg/WalkerVisitor.go index 1adda2db..c29f902b 100644 --- a/mocks/pkg/WalkerVisitor.go +++ b/mocks/pkg/WalkerVisitor.go @@ -7,6 +7,8 @@ import ( mock "github.com/stretchr/testify/mock" pkg "github.com/vektra/mockery/v2/pkg" + + testing "testing" ) // WalkerVisitor is an autogenerated mock type for the WalkerVisitor type @@ -27,3 +29,12 @@ func (_m *WalkerVisitor) VisitWalk(_a0 context.Context, _a1 *pkg.Interface) erro return r0 } + +// NewWalkerVisitor creates a new instance of WalkerVisitor. It also registers a cleanup function to assert the mocks expectations. +func NewWalkerVisitor(t testing.TB) *WalkerVisitor { + mock := &WalkerVisitor{} + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/pkg/namer.go b/mocks/pkg/namer.go index 17da8d64..9cb37e78 100644 --- a/mocks/pkg/namer.go +++ b/mocks/pkg/namer.go @@ -2,7 +2,11 @@ package mocks -import mock "github.com/stretchr/testify/mock" +import ( + mock "github.com/stretchr/testify/mock" + + testing "testing" +) // namer is an autogenerated mock type for the namer type type namer struct { @@ -22,3 +26,12 @@ func (_m *namer) Name() string { return r0 } + +// newNamer creates a new instance of namer. It also registers a cleanup function to assert the mocks expectations. +func newNamer(t testing.TB) *namer { + mock := &namer{} + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}