https://github.com/tv42/mockhttp
Mock object for Go http.ResponseWriter
https://github.com/tv42/mockhttp
Last synced: 5 days 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 (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2014-10-29T22:14:22.000Z (over 10 years ago)
- Last Synced: 2025-03-27T11:14:10.792Z (22 days ago)
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 23
- Watchers: 1
- 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.