use t.Cleanup(m.Verify)

This commit is contained in:
Nate Smith 2023-03-09 16:43:48 -08:00
parent 10dd74b4af
commit aae4023cdc
3 changed files with 2 additions and 2 deletions

View file

@ -99,6 +99,8 @@ func NewMockPrompter(t *testing.T) *MockPrompter {
ConfirmDeletionStubs: []ConfirmDeletionStub{},
}
t.Cleanup(m.Verify)
m.SelectFunc = func(p, d string, opts []string) (int, error) {
var s SelectStub

View file

@ -1429,7 +1429,6 @@ func Test_createRun_interactive(t *testing.T) {
tt.prompterStubs(t, pm)
}
tt.opts.Prompter = pm
defer pm.Verify()
rs, teardown := run.Stub()
defer teardown(t)

View file

@ -221,7 +221,6 @@ func TestRenameRun(t *testing.T) {
for _, tt := range testCases {
pm := prompter.NewMockPrompter(t)
tt.opts.Prompter = pm
defer pm.Verify()
if tt.promptStubs != nil {
tt.promptStubs(pm)
}