Skip to content

Commit

Permalink
Fix old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eklmv committed Nov 12, 2022
1 parent ea37b18 commit 811c657
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pgxmock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ func TestPrepareExec(t *testing.T) {
mock.ExpectBegin()
ep := mock.ExpectPrepare("foo", "INSERT INTO ORDERS\\(ID, STATUS\\) VALUES \\(\\?, \\?\\)")
for i := 0; i < 3; i++ {
ep.ExpectExec().WillReturnResult(NewResult("UPDATE", 1))
ep.ExpectExec().WithArgs(AnyArg(), AnyArg()).WillReturnResult(NewResult("UPDATE", 1))
}
mock.ExpectCommit()
tx, _ := mock.Begin(context.Background())
Expand Down Expand Up @@ -1071,7 +1071,7 @@ func TestPreparedStatementCloseExpectation(t *testing.T) {
defer mock.Close(context.Background())

ep := mock.ExpectPrepare("foo", "INSERT INTO ORDERS").WillBeClosed()
ep.ExpectExec().WillReturnResult(NewResult("UPDATE", 1))
ep.ExpectExec().WithArgs(AnyArg(), AnyArg()).WillReturnResult(NewResult("UPDATE", 1))

_, err = mock.Prepare(context.Background(), "foo", "INSERT INTO ORDERS(ID, STATUS) VALUES (?, ?)")
if err != nil {
Expand Down Expand Up @@ -1101,7 +1101,7 @@ func TestExecExpectationErrorDelay(t *testing.T) {

// test that return of error is delayed
delay := time.Millisecond * 100
mock.ExpectExec("^INSERT INTO articles").
mock.ExpectExec("^INSERT INTO articles").WithArgs(AnyArg()).
WillReturnError(errors.New("slow fail")).
WillDelayFor(delay)

Expand Down

0 comments on commit 811c657

Please sign in to comment.