mirror of
https://github.com/kataras/iris.git
synced 2026-01-11 05:55:57 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -76,7 +76,6 @@ func (m myTestTask) OnServe(host TaskHost) {
|
||||
time.AfterFunc(startDelay, func() {
|
||||
m.logger.Println("restart")
|
||||
host.Serve() // restart
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ const (
|
||||
)
|
||||
|
||||
func newTester(t *testing.T, baseURL string, handler http.Handler) *httpexpect.Expect {
|
||||
|
||||
var transporter http.RoundTripper
|
||||
|
||||
if strings.HasPrefix(baseURL, "http") { // means we are testing real serve time
|
||||
@@ -57,9 +56,8 @@ func testSupervisor(t *testing.T, creator func(*http.Server, []func(TaskHost)) *
|
||||
)
|
||||
|
||||
// http routing
|
||||
var (
|
||||
expectedBody = "this is the response body\n"
|
||||
)
|
||||
|
||||
expectedBody := "this is the response body\n"
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -98,6 +96,7 @@ func testSupervisor(t *testing.T, creator func(*http.Server, []func(TaskHost)) *
|
||||
t.Fatalf("expected hello Task's message to be '%s' but got '%s'", expectedHelloMessage, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSupervisor(t *testing.T) {
|
||||
testSupervisor(t, func(srv *http.Server, tasks []func(TaskHost)) *Supervisor {
|
||||
su := New(srv)
|
||||
|
||||
Reference in New Issue
Block a user