Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tv42/mockhttp
Mock object for Go http.ResponseWriter
https://github.com/tv42/mockhttp
Last synced: 2 months ago
JSON representation
Mock object for Go http.ResponseWriter
- Host: GitHub
- URL: https://github.com/tv42/mockhttp
- Owner: tv42
- License: mit
- Created: 2011-06-11T16:03:01.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T22:14:22.000Z (about 10 years ago)
- Last Synced: 2024-07-31T20:53:10.007Z (5 months ago)
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 23
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - mockhttp - Mock object for Go http.ResponseWriter. (Testing / Mock)
- awesome-go - mockhttp - Mock object for Go http.ResponseWriter - ★ 22 (Testing)
- awesome-go-extra - mockhttp - 06-11T16:03:01Z|2014-10-29T22:14:22Z| (Testing / Mock)
README
# mockhttp -- Go package for unit testing HTTP serving
Unit testing HTTP services written in Go means you need to call their
`ServeHTTP` receiver. For this, you need something that fulfills the
`http.ResponseWriter` interface, and you need to populate a
`http.Request` struct with suitable-looking data. `mockhttp.go`
helps you do these tasks, without excessive copy-pasting.See `mockhttp_test.go` for an example of usage.