1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-06-12 21:47:29 +02:00

Rows interface to allow building rows in different ways

This commit is contained in:
gedi
2014-02-14 00:14:32 +02:00
parent 008d8847b2
commit bdba0bb0c6
4 changed files with 80 additions and 16 deletions

View File

@ -33,7 +33,7 @@ to work with:
// expect query to fetch order, match it with regexp
sqlmock.ExpectQuery("SELECT (.+) FROM orders (.+) FOR UPDATE").
WithArgs(1).
WillReturnRows(sqlmock.RowsFromCSVString(columns, "1,1"))
WillReturnRows(sqlmock.NewRows(columns).FromCSVString("1,1"))
// expect transaction rollback, since order status is "cancelled"
sqlmock.ExpectRollback()