1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-30 10:11:23 +02:00
woodpecker/vendor/github.com/Bugagazavr/go-gitlab-client/helper_test.go

17 lines
348 B
Go
Raw Normal View History

2015-07-27 01:25:20 +02:00
package gogitlab
import (
"io/ioutil"
"net/http"
"net/http/httptest"
)
func Stub(filename string) (*httptest.Server, *Gitlab) {
stub, _ := ioutil.ReadFile(filename)
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(stub))
}))
gitlab := NewGitlab(ts.URL, "", "")
return ts, gitlab
}