-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(empty-return): move tests to correct location
- Loading branch information
Showing
7 changed files
with
147 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 0 additions & 98 deletions
98
mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmptyReturn.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
m := NewEmptyReturnMock(t) | ||
var target EmptyReturn = m | ||
|
||
t.Run("NoArgs", func(t *testing.T) { | ||
run := false | ||
|
||
m.EXPECT().NoArgs().RunAndReturn(func() { | ||
run = true | ||
}) | ||
|
||
target.NoArgs() | ||
|
||
require.True(t, run) | ||
}) | ||
|
||
t.Run("WithArgs", func(t *testing.T) { | ||
run := false | ||
|
||
m.EXPECT().WithArgs(42, "foo").RunAndReturn(func(arg0 int, arg1 string) { | ||
run = true | ||
require.Equal(t, 42, arg0) | ||
require.Equal(t, "foo", arg1) | ||
}) | ||
|
||
target.WithArgs(42, "foo") | ||
|
||
require.True(t, run) | ||
}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
pkg/fixtures/iface_typed_param/getter_iface_typed_param_mock_test.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.