Skip to content

Commit

Permalink
docs: fix TOC and example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Fellows committed Oct 18, 2019
1 parent c665e28 commit f8ed328
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
59 changes: 56 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,59 @@ Read [Getting started with Pact] for more information for beginners.

## Table of Contents

<!-- TOC -->autoauto- [Pact Go](#pact-go)auto - [Introduction](#introduction)auto - [Table of Contents](#table-of-contents)auto - [Versions](#versions)auto - [Installation](#installation)auto - [Go get](#go-get)auto - [Installation on \*nix](#installation-on-\nix)auto - [Using Pact](#using-pact)auto - [HTTP API Testing](#http-api-testing)auto - [Consumer Side Testing](#consumer-side-testing)auto - [Provider API Testing](#provider-api-testing)auto - [Provider Verification](#provider-verification)auto - [Provider States](#provider-states)auto - [Before and After Hooks](#before-and-after-hooks)auto - [Request Filtering](#request-filtering)auto - [Example: API with Authorization](#example-api-with-authorization)auto - [Lifecycle of a provider verification](#lifecycle-of-a-provider-verification)auto - [Publishing pacts to a Pact Broker and Tagging Pacts](#publishing-pacts-to-a-pact-broker-and-tagging-pacts)auto - [Publishing from Go code](#publishing-from-go-code)auto - [Publishing Provider Verification Results to a Pact Broker](#publishing-provider-verification-results-to-a-pact-broker)auto - [Publishing from the CLI](#publishing-from-the-cli)auto - [Using the Pact Broker with Basic authentication](#using-the-pact-broker-with-basic-authentication)auto - [Using the Pact Broker with Bearer Token authentication](#using-the-pact-broker-with-bearer-token-authentication)auto - [Asynchronous API Testing](#asynchronous-api-testing)auto - [Consumer](#consumer)auto - [Provider (Producer)](#provider-producer)auto - [Pact Broker Integration](#pact-broker-integration)auto - [Matching](#matching)auto - [Matching on types](#matching-on-types)auto - [Matching on arrays](#matching-on-arrays)auto - [Matching by regular expression](#matching-by-regular-expression)auto - [Match common formats](#match-common-formats)auto - [Auto-generate matchers from struct tags](#auto-generate-matchers-from-struct-tags)auto - [Examples](#examples)auto - [HTTP APIs](#http-apis)auto - [Asynchronous APIs](#asynchronous-apis)auto - [Integrated examples](#integrated-examples)auto - [Troubleshooting](#troubleshooting)auto - [Splitting tests across multiple files](#splitting-tests-across-multiple-files)auto - [Output Logging](#output-logging)auto - [Check if the CLI tools are up to date](#check-if-the-cli-tools-are-up-to-date)auto - [Disable CLI checks to speed up tests](#disable-cli-checks-to-speed-up-tests)auto - [Re-run a specific provider verification test](#re-run-a-specific-provider-verification-test)auto - [Contact](#contact)auto - [Documentation](#documentation)auto - [Roadmap](#roadmap)auto - [Contributing](#contributing)autoauto<!-- /TOC -->

<!-- TOC -->

- [Pact Go](#pact-go)
- [Introduction](#introduction)
- [Table of Contents](#table-of-contents)
- [Versions](#versions)
- [Installation](#installation)
- [Go get](#go-get)
- [Installation on \*nix](#installation-on-\nix)
- [Using Pact](#using-pact)
- [HTTP API Testing](#http-api-testing)
- [Consumer Side Testing](#consumer-side-testing)
- [Provider API Testing](#provider-api-testing)
- [Provider Verification](#provider-verification)
- [Provider States](#provider-states)
- [Before and After Hooks](#before-and-after-hooks)
- [Request Filtering](#request-filtering)
- [Example: API with Authorization](#example-api-with-authorization)
- [Lifecycle of a provider verification](#lifecycle-of-a-provider-verification)
- [Publishing pacts to a Pact Broker and Tagging Pacts](#publishing-pacts-to-a-pact-broker-and-tagging-pacts)
- [Publishing from Go code](#publishing-from-go-code)
- [Publishing Provider Verification Results to a Pact Broker](#publishing-provider-verification-results-to-a-pact-broker)
- [Publishing from the CLI](#publishing-from-the-cli)
- [Using the Pact Broker with Basic authentication](#using-the-pact-broker-with-basic-authentication)
- [Using the Pact Broker with Bearer Token authentication](#using-the-pact-broker-with-bearer-token-authentication)
- [Asynchronous API Testing](#asynchronous-api-testing)
- [Consumer](#consumer)
- [Provider (Producer)](#provider-producer)
- [Pact Broker Integration](#pact-broker-integration)
- [Matching](#matching)
- [Matching on types](#matching-on-types)
- [Matching on arrays](#matching-on-arrays)
- [Matching by regular expression](#matching-by-regular-expression)
- [Match common formats](#match-common-formats)
- [Auto-generate matchers from struct tags](#auto-generate-matchers-from-struct-tags)
- [Examples](#examples)
- [HTTP APIs](#http-apis)
- [Asynchronous APIs](#asynchronous-apis)
- [Integrated examples](#integrated-examples)
- [Troubleshooting](#troubleshooting)
- [Splitting tests across multiple files](#splitting-tests-across-multiple-files)
- [Output Logging](#output-logging)
- [Check if the CLI tools are up to date](#check-if-the-cli-tools-are-up-to-date)
- [Disable CLI checks to speed up tests](#disable-cli-checks-to-speed-up-tests)
- [Re-run a specific provider verification test](#re-run-a-specific-provider-verification-test)
- [Verifying APIs with a self-signed certificate](#verifying-apis-with-a-self-signed-certificate)
- [Testing AWS API Gateway APIs](#testing-aws-api-gateway-apis)
- [Contact](#contact)
- [Documentation](#documentation)
- [Roadmap](#roadmap)
- [Contributing](#contributing)

<!-- /TOC -->
## Versions

<details><summary>Specification Compatibility</summary>
Expand Down Expand Up @@ -101,7 +152,7 @@ The simple example looks like this:

```go
func TestConsumer(t *testing.T) {
type struct {
type User struct {
Name string `json:"name" pact:"example=billy"`
LastName string `json:"lastName" pact:"example=sampson"`
}
Expand Down Expand Up @@ -156,6 +207,8 @@ func TestConsumer(t *testing.T) {
if err := pact.Verify(test); err != nil {
log.Fatalf("Error on Verify: %v", err)
}

return nil
}

```
Expand Down
2 changes: 1 addition & 1 deletion command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var versionCmd = &cobra.Command{
Short: "Print the version number of Pact Go",
Long: `All software has versions. This is Pact Go's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Pact Go CLI v1.0.0-beta.8, using CLI tools version", cliToolsVersion)
fmt.Println("Pact Go CLI v1.0.0, using CLI tools version", cliToolsVersion)
},
}

Expand Down

0 comments on commit f8ed328

Please sign in to comment.