Skip to content

Commit

Permalink
improvements after code review #729
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmarquezini committed Nov 20, 2023
1 parent 432134c commit d0fa1f9
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package test
package test_test

import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

mocks "github.com/vektra/mockery/v2/mocks/github.com/vektra/mockery/v2/pkg/fixtures"
)

Expand All @@ -18,10 +19,10 @@ func TestPanicOnNoReturnValue(t *testing.T) {
}()
defer func() {
panicOccurred = true
if r := recover(); r != nil {
require.NotNil(t, r)
assert.Equal(t, "no return value specified for DoSomething", r.(string))
}

r := recover()
require.NotNil(t, r)
assert.Equal(t, "no return value specified for DoSomething", r.(string))
}()

m.DoSomething()
Expand Down

0 comments on commit d0fa1f9

Please sign in to comment.