Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #18 from suzuki-shunsuke/test/upgrade-flute
Browse files Browse the repository at this point in the history
test: upgrade flute
  • Loading branch information
suzuki-shunsuke committed Jun 15, 2020
2 parents 5cbc48f + f390929 commit 5131068
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.14

require (
github.com/stretchr/testify v1.6.1
github.com/suzuki-shunsuke/flute v0.7.0
github.com/suzuki-shunsuke/flute/v2 v2.0.0-0
)
21 changes: 13 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/suzuki-shunsuke/flute v0.7.0 h1:DvDSCMIMiLlRj4AQPMeJ1NfHE3lG5yfs2LU0Dnf1+oc=
github.com/suzuki-shunsuke/flute v0.7.0/go.mod h1:UZOMr3GyEuYSr7/zf0nHgaLP9ZhKDB+2pBeV1WFkohE=
github.com/suzuki-shunsuke/flute/v2 v2.0.0-0 h1:uxzfDeVxNp7GA4GSAlTBV7rA5TbHXV4Q68cNebOEAZk=
github.com/suzuki-shunsuke/flute/v2 v2.0.0-0/go.mod h1:wsUAUZbz+DSjv+XDv/gZeEX/mMu1y9kzIXCN5Slu6NY=
github.com/suzuki-shunsuke/go-cliutil v0.0.0-20181211154308-176f852d9bca/go.mod h1:Vq3NkhgmA9DT/2UZ08x/3A34xxvzQ/vTMABnTWKoMbY=
github.com/suzuki-shunsuke/go-jsoneq v0.1.1 h1:A9ik3qCfjjR2zbOTHwOIIt+N4ItZGZq9j8z//t5EhnQ=
github.com/suzuki-shunsuke/go-jsoneq v0.1.1/go.mod h1:vbOEb6bPf8nD+QASKzxtQ/vfVGgAyfWHyItUaUTwJWk=
github.com/suzuki-shunsuke/gomic v0.5.6/go.mod h1:GEDQnxOB07p3mTZG/MiuclfyfcqnNqp0rt9AHgIzs7Q=
github.com/suzuki-shunsuke/go-jsoneq v0.1.2 h1:A4czEbmFqSELTbrEtXVo4dSgfz2e2Z0y6G3OpExUML8=
github.com/suzuki-shunsuke/go-jsoneq v0.1.2/go.mod h1:ETXAwfruZTqMMKDxc9CYoS34CNSsnzcdcVIAW3+RujI=
github.com/suzuki-shunsuke/gomic v0.6.0/go.mod h1:/+uhQJ1H5f9ythus/MbXOotAZDmkN1QOjKlsSiH2v+I=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190802220118-1d1727260058/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
Expand Down
22 changes: 11 additions & 11 deletions httpclient/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/suzuki-shunsuke/flute/flute"
"github.com/suzuki-shunsuke/flute/v2/flute"
)

func TestError_Error(t *testing.T) {
Expand Down Expand Up @@ -63,11 +63,11 @@ func TestClient_Call(t *testing.T) {
userAgent := "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
routeCreateUser := flute.Route{
Name: "create a user",
Matcher: &flute.Matcher{
Matcher: flute.Matcher{
Method: "POST",
Path: "/api/users",
},
Tester: &flute.Tester{
Tester: flute.Tester{
BodyJSONString: `{
"name": "foo",
"email": "foo@example.com"
Expand All @@ -76,7 +76,7 @@ func TestClient_Call(t *testing.T) {
"Authorization": []string{"token " + token},
},
},
Response: &flute.Response{
Response: flute.Response{
Base: http.Response{
StatusCode: 201,
},
Expand All @@ -89,11 +89,11 @@ func TestClient_Call(t *testing.T) {
}
routeCreateUserTimeout := flute.Route{
Name: "create a user",
Matcher: &flute.Matcher{
Matcher: flute.Matcher{
Method: "POST",
Path: "/api/users",
},
Tester: &flute.Tester{
Tester: flute.Tester{
BodyJSONString: `{
"name": "foo",
"email": "foo@example.com"
Expand All @@ -102,7 +102,7 @@ func TestClient_Call(t *testing.T) {
"Authorization": []string{"token " + token},
},
},
Response: &flute.Response{
Response: flute.Response{
Response: func(req *http.Request) (*http.Response, error) {
ctx := req.Context()
type resp struct {
Expand Down Expand Up @@ -207,11 +207,11 @@ func TestClient_Call(t *testing.T) {
routes: []flute.Route{
{
Name: "get a group",
Matcher: &flute.Matcher{
Matcher: flute.Matcher{
Method: "GET",
Path: "/api/groups/foo",
},
Response: &flute.Response{
Response: flute.Response{
Base: http.Response{
StatusCode: 404,
},
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestClient_Call(t *testing.T) {
routes: []flute.Route{
{
Name: "get a group with query",
Matcher: &flute.Matcher{
Matcher: flute.Matcher{
Method: "GET",
Path: "/api/groups",
Header: http.Header{
Expand All @@ -250,7 +250,7 @@ func TestClient_Call(t *testing.T) {
"name": []string{"foo"},
},
},
Response: &flute.Response{
Response: flute.Response{
Base: http.Response{
StatusCode: 404,
},
Expand Down

0 comments on commit 5131068

Please sign in to comment.