Skip to content

Commit c4d8b61

Browse files
author
Stein Fletcher
committed
Fix incorrect order of 'expected' and 'actual' when diffing failing mocks
1 parent 7e4b0d9 commit c4d8b61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mocks.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1030,10 +1030,10 @@ var bodyMatcher = func(req *http.Request, spec *MockRequest) error {
10301030
}
10311031

10321032
if isJSON {
1033-
return fmt.Errorf("received body did not match expected mock body\n%s", diff(reqJSON, matchJSON))
1033+
return fmt.Errorf("received body did not match expected mock body\n%s", diff(matchJSON, reqJSON))
10341034
}
10351035

1036-
return fmt.Errorf("received body did not match expected mock body\n%s", diff(bodyStr, mockBody))
1036+
return fmt.Errorf("received body did not match expected mock body\n%s", diff(mockBody, bodyStr))
10371037
}
10381038

10391039
func errorOrNil(statement bool, errorMessage func() string) error {

0 commit comments

Comments
 (0)