From 5f6413d60ae36322c72d4a6d39a2eeb2b12e18f5 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Fri, 9 Aug 2013 13:38:30 -0600 Subject: [PATCH] added test round tripper --- http/test_round_tripper.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 http/test_round_tripper.go diff --git a/http/test_round_tripper.go b/http/test_round_tripper.go new file mode 100644 index 0000000..b0ad545 --- /dev/null +++ b/http/test_round_tripper.go @@ -0,0 +1,15 @@ +package http + +import ( + "github.com/stretchr/testify/mock" + "net/http" +) + +type TestRoundTripper struct { + mock.Mock +} + +func (t *TestRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + args := t.Called(req) + return args.Get(0).(*http.Response), args.Error(1) +}