added test round tripper

pull/21/merge
Mat Ryer 2013-08-09 13:38:30 -06:00
parent ba887bba64
commit 5f6413d60a
1 changed files with 15 additions and 0 deletions

View File

@ -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)
}