DATA-DOG / go-sqlmock

Sql mock driver for golang to test database interactions
Other
6.05k stars 406 forks source link

Only the last expectation works if defining multiple #202

Closed straightdave closed 4 years ago

straightdave commented 4 years ago

Hi, it maybe not an issue.

I have a function with one SELECT and then a UPDATE operation inside. I created two expectations, one is intended to match SELECT and the other is for UPDATE. In the test process when executing the SELECT operation, it failed since not mating the UPDATE expectation, which is defined at last.

Any suggestion?

straightdave commented 4 years ago

Sorry. It seems not the case.