https://github.com/martinohmann/godog-http
Feature context for godog that adds http testing steps
https://github.com/martinohmann/godog-http
bdd cucumber gherkin golang http integration-testing
Last synced: 18 days ago
JSON representation
Feature context for godog that adds http testing steps
- Host: GitHub
- URL: https://github.com/martinohmann/godog-http
- Owner: martinohmann
- License: mit
- Created: 2019-03-18T19:19:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-20T19:16:54.000Z (over 6 years ago)
- Last Synced: 2025-02-23T11:15:54.519Z (4 months ago)
- Topics: bdd, cucumber, gherkin, golang, http, integration-testing
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
godog-http
==========[](https://travis-ci.org/martinohmann/godog-http)
[](https://codecov.io/gh/martinohmann/godog-http)
[](https://goreportcard.com/report/github.com/martinohmann/godog-http)
[](https://godoc.org/github.com/martinohmann/godog-http)godog-http defines a godog feature context which adds steps to test `http.Handler` implementations.
Installation
------------```sh
go get -u github.com/martinohmann/godog-http
```Usage
-----Example feature:
```
Feature: As a developer, I want to be able to setup and verify http routers in
godog features.Scenario: I make a JSON request
Given I have following request headers:
| name | value |
| X-Auth | supersecret |
And I have following request body:
"""
{"foo":{"bar":{"baz":1}},"something":"else"}
"""
When I send "POST" request to "/foo"
Then the response code should be 200
And the response should contain following json:
"""
{"something":"else","foo":{"bar":{"baz":1}}}
"""
And the response should have following headers:
| name | value |
| Content-Type | application/json |
```Check [`feature_context_test.go`](feature_context_test.go) and the
[`features/`](features/) directory for more usage examples.License
-------The source code of godog-http is released under the MIT License. See the bundled
LICENSE file for details.