Skip to content

Commit

Permalink
Merge pull request #466 from LandonTClipp/testing_tb
Browse files Browse the repository at this point in the history
Reduce size of interface passed to mock constructor
  • Loading branch information
LandonTClipp authored May 24, 2022
2 parents 1d92e73 + 41e99e1 commit 68d25fe
Show file tree
Hide file tree
Showing 60 changed files with 896 additions and 550 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ test: mocks
mocks: $(shell find . -type f -name '*.go' -not -name '*_test.go')
go run . --dir pkg/fixtures --output mocks/pkg/fixtures
go run . --all=false --print --dir pkg/fixtures --name RequesterVariadic --structname RequesterVariadicOneArgument --unroll-variadic=False > mocks/pkg/fixtures/RequesterVariadicOneArgument.go
go run . --all=false --print --dir pkg/fixtures --name ExpecterTest --structname ExpecterTestWithExpecter --with-expecter=True > mocks/pkg/fixtures/ExpecterTestWithExpecter.go
@touch mocks

.PHONY: install
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (m *Stringer) String() string {
return r0
}

// NewStringer creates a new instance of Stringer. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
// NewStringer creates a new instance of Stringer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewStringer(t testing.TB) *Stringer {
mock := &Stringer{}
mock.Mock.Test(t)
Expand Down Expand Up @@ -168,7 +168,7 @@ func (_m *SendFunc) Execute(data string) (int, error) {
return r0, r1
}

// NewSendFunc creates a new instance of SendFunc. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
// NewSendFunc creates a new instance of SendFunc. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewSendFunc(t testing.TB) *SendFunc {
mock := &SendFunc{}
mock.Mock.Test(t)
Expand Down
40 changes: 0 additions & 40 deletions mocks/cmd/stackTracer.go

This file was deleted.

37 changes: 0 additions & 37 deletions mocks/pkg/Cleanup.go

This file was deleted.

60 changes: 0 additions & 60 deletions mocks/pkg/OutputStreamProvider.go

This file was deleted.

40 changes: 0 additions & 40 deletions mocks/pkg/WalkerVisitor.go

This file was deleted.

11 changes: 7 additions & 4 deletions mocks/pkg/fixtures/A.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions mocks/pkg/fixtures/AsyncProducer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions mocks/pkg/fixtures/Blank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions mocks/pkg/fixtures/ConsulLock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions mocks/pkg/fixtures/Example.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions mocks/pkg/fixtures/ExpecterTest.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 68d25fe

Please sign in to comment.