How to recover argument sent to mock with Ginkgo

187 views Asked by At

I am working with /onsi/ginkgo/v2 v2.1.4 and /golang/mock v1.6.0 in Golang v1.19.2

And I want to retrieve the argument that was sent to the mock's InsertOneProspecto function.

ctrl = gomock.NewController(GinkgoT())
mockDB = mock.NewMockPersistence(ctrl)
recInsert:=mockDB.EXPECT()
callInsert:=recInsert.InsertOneProspecto(gomock.Any()).Return("1098101810", nil)
.
.
// Tested procedure called
.
.
// All is OK
// Recover the argument inyected to InsertOneProspecto
// example:
var myArg dom.Prospect 
myArg:=callInsert.Call[0].Arguments[0]
```


0

There are 0 answers