Skip to content
Mock object for Go http.ResponseWriter
Go
Branch: master
Clone or download
Latest commit c323b80 Oct 30, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Modernize Oct 29, 2014
LICENSE Add LICENSE Oct 29, 2014
README.md Reformat README Oct 29, 2014
mockhttp_test.go NewRequest now takes testing.TB, does not panic Oct 29, 2014
mockrequest.go NewRequest now takes testing.TB, does not panic Oct 29, 2014
mockresponsewriter.go golint cleanup Oct 29, 2014

README.md

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.

You can’t perform that action at this time.