Skip to content

Commit

Permalink
fix(client_test)
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Feb 13, 2021
1 parent 2d0ef7e commit 3976d1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/http/httptest"
"testing"
"strings"

"github.com/nbio/st"
"gopkg.in/h2non/gentleman.v2/context"
Expand Down Expand Up @@ -302,7 +303,6 @@ func TestClientVerbMethods(t *testing.T) {
}

func TestClientWithCanceledContext(t *testing.T) {

ctx, cancel := gocontext.WithCancel(gocontext.Background())
cancel()
_, err := New().
Expand All @@ -311,5 +311,6 @@ func TestClientWithCanceledContext(t *testing.T) {
Post().
Path("/test").
Send()
st.Expect(t, err.Error(), "Post http://localhost:8999/test: context canceled")

st.Expect(t, strings.Contains(err.Error(), "context canceled"), true)
}

0 comments on commit 3976d1b

Please sign in to comment.