Skip to content
This repository was archived by the owner on Sep 27, 2020. It is now read-only.

Commit de8d414

Browse files
authored
Refactor name (#39)
* refactor: rename ex -> hook * refactor: rename SnapshotTesting() -> GetExpectedFromSnapshot() * ci
1 parent 977d0a3 commit de8d414

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ jobs:
88
- image: circleci/golang:1.12
99

1010
working_directory: /go/src/github.com/podhmo/go-webtest
11+
environment:
12+
GO111MODULE=on
1113
steps:
1214
- checkout
1315

1416
# specify any bash command here prefixed with `run: `
1517
- run: go get -v -t -d ./...
1618
- run: go test -v ./...
19+

ex/expect_status_code.go hook/expect_status_code.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ex
1+
package hook
22

33
import (
44
"fmt"

ex/middleware.go hook/middleware.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ex
1+
package hook
22

33
import (
44
"net/http"

ex/snapshot_testing.go hook/snapshot_testing.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package ex
1+
package hook
22

33
import (
44
"net/http"
@@ -8,8 +8,8 @@ import (
88
"github.com/podhmo/go-webtest/snapshot"
99
)
1010

11-
// SnapshotTesting :
12-
func SnapshotTesting(want *interface{}, options ...func(sc *snapshot.Config)) func(*webtest.Config) {
11+
// GetExpectedDataFromSnapshot :
12+
func GetExpectedDataFromSnapshot(want *interface{}, options ...func(sc *snapshot.Config)) func(*webtest.Config) {
1313
return func(c *webtest.Config) {
1414
c.Middlewares = append(c.Middlewares, NewMiddleware(
1515
func(

httpbin/integration_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"testing"
55

66
webtest "github.com/podhmo/go-webtest"
7+
"github.com/podhmo/go-webtest/hook"
78
"github.com/podhmo/go-webtest/httpbin/httpbintest"
89
"github.com/podhmo/go-webtest/jsonequal"
9-
"github.com/podhmo/go-webtest/ex"
1010
"github.com/podhmo/noerror"
1111
)
1212

@@ -37,7 +37,7 @@ func TestIt(t *testing.T) {
3737
t.Run("with middlewares", func(t *testing.T) {
3838
t.Run("200, status check", func(t *testing.T) {
3939
client := client.Bind(
40-
ex.ExpectCode(200),
40+
hook.ExpectCode(200),
4141
)
4242
got, err, teardown := client.Do(t, "/status/200")
4343
noerror.Must(t, err)
@@ -55,7 +55,7 @@ func TestIt(t *testing.T) {
5555
var want interface{}
5656

5757
client := client.Bind(
58-
ex.SnapshotTesting(&want),
58+
hook.GetExpectedDataFromSnapshot(&want),
5959
)
6060

6161
cases := []struct {

0 commit comments

Comments
 (0)