Skip to content

Commit

Permalink
doc(readme): installation via "tools package" (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
blgm authored Jun 9, 2020
1 parent 0624f75 commit 83bb20e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,36 @@ Ginkgo is best paired with Gomega. Learn more about Gomega [here](https://onsi.

Agouti allows you run WebDriver integration tests. Learn more about Agouti [here](https://agouti.org)

## Set Me Up!
## Getting Started

You'll need the Go command-line tools. Ginkgo is tested with Go 1.6+, but preferably you should get the latest. Follow the [installation instructions](https://golang.org/doc/install) if you don't have it installed.
You'll need the Go command-line tools. Follow the [installation instructions](https://golang.org/doc/install) if you don't have it installed.

### Global installation
To install the Ginkgo command line interface into the `$PATH` (actually to `$GOBIN`):
```bash
go get -u github.com/onsi/ginkgo/ginkgo
```

### Go module ["tools package"](https://github.com/golang/go/issues/25922):
Create (or update) a file called `tools/tools.go` with the following contents:
```go
// +build tools

package tools

go get -u github.com/onsi/ginkgo/ginkgo # installs the ginkgo CLI
go get -u github.com/onsi/gomega/... # fetches the matcher library
import (
_ "github.com/onsi/ginkgo"
)

// This file imports packages that are used when running go generate, or used
// during the development process but not otherwise depended on by built code.
```
The Ginkgo command can then be run via `go run github.com/onsi/ginkgo/ginkgo`.
This approach allows the version of Ginkgo to be maintained under source control for reproducible results,
and is well suited to automated test pipelines.

### Bootstrapping
```bash
cd path/to/package/you/want/to/test

ginkgo bootstrap # set up a new ginkgo suite
Expand Down

0 comments on commit 83bb20e

Please sign in to comment.