You've already forked go-sqlmock
mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-07-03 00:36:52 +02:00
closes #114 allow expecting rows to be closed
This commit is contained in:
@ -176,6 +176,13 @@ func (c *sqlmock) ExpectationsWereMet() error {
|
||||
return fmt.Errorf("expected prepared statement to be closed, but it was not: %s", prep)
|
||||
}
|
||||
}
|
||||
|
||||
// must check whether all expected queried rows are closed
|
||||
if query, ok := e.(*ExpectedQuery); ok {
|
||||
if query.rowsMustBeClosed && !query.rowsWereClosed {
|
||||
return fmt.Errorf("expected query rows to be closed, but it was not: %s", query)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user