Skip to content

Commit

Permalink
Add imports inside README.md example
Browse files Browse the repository at this point in the history
  • Loading branch information
Peltoche committed Oct 1, 2018
1 parent 5264eaa commit 6be3379
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ integrated inside you http.Client from you already existing tests.
## Example

```go
import (
"github.com/stretchr/testify/assert"
"gitlab.com/Peltoche/oaichecker"
)

func Test_Posting_a_valid_pet(t *testing.T) {
// Loads the specs file.
//
// It contains only a the specs for the endpoint 'GET /pets'.
specs, err := NewSpecsFromFile("./dataset/petstore_minimal.json")
specs, err := oaichecker.NewSpecsFromFile("./dataset/petstore_minimal.json")
require.NoError(t, err)

// Create a client which the custom transport
client := http.Client{
Transport: NewTransport(specs),
Transport: oaichecker.NewTransport(specs),
}

// Make the requests as usual.
Expand Down

0 comments on commit 6be3379

Please sign in to comment.