improve integration test error handling

This commit is contained in:
Lucas Clemente 2016-07-08 13:58:05 +02:00
parent f43c4c7f1a
commit c672f461de

View file

@ -60,16 +60,19 @@ func setupHTTPHandlers() {
Expect(err).NotTo(HaveOccurred())
http.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
_, err := io.WriteString(w, "Hello, World!\n")
Expect(err).NotTo(HaveOccurred())
})
http.HandleFunc("/data", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
_, err := w.Write(data)
Expect(err).NotTo(HaveOccurred())
})
http.HandleFunc("/echo", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
_, err := io.Copy(w, r.Body)
Expect(err).NotTo(HaveOccurred())
})