Skip to content

Commit

Permalink
fix(docs): Fix code examples, update E2E test steps (#110)
Browse files Browse the repository at this point in the history
fix(docs): fix code examples, update E2E test steps
  • Loading branch information
devenney authored and mefellows committed Apr 1, 2019
1 parent 93caeeb commit 467dea5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please provide the following information with your issue to enable us to respond
You can run the E2E tests by:

```sh
make package # Assemble the latest Pact Go from Ruby and compile Go
make tools # Assemble the latest Pact Go from Ruby and compile Go
make pact # Run the Pact tests - consumer + provider
```

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,20 @@ func TestConsumer(t *testing.T) {
// Pass in test case. This is the component that makes the external HTTP call
var test = func() (err error) {
u := fmt.Sprintf("http://localhost:%d/foobar", pact.Server.Port)
req, _ := http.NewRequest("GET", u, strings.NewReader(`{"name":"billy"}`))
req, err := http.NewRequest("GET", u, strings.NewReader(`{"name":"billy"}`))
if err != nil {
return err
}

// NOTE: by default, request bodies are expected to be sent with a Content-Type
// of application/json. If you don't explicitly set the content-type, you
// will get a mismatch during Verification.
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer 1234")

_, err = http.DefaultClient.Do(req); err != nil {
return
if _, err = http.DefaultClient.Do(req); err != nil {
return err
}
}

// Set up our expected interactions.
Expand Down

0 comments on commit 467dea5

Please sign in to comment.