Mocking XORM Issue #2045

Open
opened 2021-09-11 12:19:34 +00:00 by yupithecat · 1 comment

I got errors in my unit test when mocking xorm using gopkg.in/DATA-DOG/go-sqlmock. I found this issue https://gitea.com/xorm/xorm/issues/1276 that suggest to use gopkg.in/testfixtures.v2 as a mocking library, but after reading the documentation about testfixtures.v2 on its github, I don't have any idea how to implement it, especially without using yaml file. Could anyone please help me to give an example how to implement it? Or is there other mocking library that I could use? Thanks

I got errors in my unit test when mocking xorm using `gopkg.in/DATA-DOG/go-sqlmock`. I found this issue [https://gitea.com/xorm/xorm/issues/1276](https://) that suggest to use `gopkg.in/testfixtures.v2` as a mocking library, but after reading the documentation about `testfixtures.v2` on its github, I don't have any idea how to implement it, especially without using yaml file. Could anyone please help me to give an example how to implement it? Or is there other mocking library that I could use? Thanks
Owner

You can find the example eb03e819d3/models/test_fixtures.go (L61)

You can find the example https://github.com/go-gitea/gitea/blob/eb03e819d323f6374d0a99a5b80d4674a18fa957/models/test_fixtures.go#L61
lunny added the
kind
testing
label 2021-09-11 13:51:59 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#2045
No description provided.