testify/mock/mock_objx_test.go
Olivier Mengué 580d807112 mock: add build tag 'testify_no_objx' to opt-out of objx
Add build tag testify_no_objx to allow to exclude method Mock.TestData()
for avoiding dependency on github.com/stretchr/objx.
2025-08-25 14:13:40 +02:00

22 lines
410 B
Go

//go:build !testify_no_objx && !testify_no_deps
package mock
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_Mock_TestData(t *testing.T) {
t.Parallel()
var mockedService = new(TestExampleImplementation)
if assert.NotNil(t, mockedService.TestData()) {
mockedService.TestData().Set("something", 123)
assert.Equal(t, 123, mockedService.TestData().Get("something").Data())
}
}