(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func Test_Proxying_Build_Errors(t *testing.T) { |
| 94 | builder := NewMockBuilder() |
| 95 | builder.MockErrors = "Foo bar here are some errors" |
| 96 | runner := NewMockRunner() |
| 97 | proxy := gin.NewProxy(builder, runner) |
| 98 | |
| 99 | config := &gin.Config{ |
| 100 | Port: 5679, |
| 101 | ProxyTo: "http://localhost:3000", |
| 102 | } |
| 103 | |
| 104 | err := proxy.Run(config) |
| 105 | defer proxy.Close() |
| 106 | expect(t, err, nil) |
| 107 | |
| 108 | res, err := http.Get("http://localhost:5679") |
| 109 | expect(t, err, nil) |
| 110 | expect(t, res == nil, false) |
| 111 | errors, err := ioutil.ReadAll(res.Body) |
| 112 | res.Body.Close() |
| 113 | expect(t, fmt.Sprintf("%s", errors), "Foo bar here are some errors") |
| 114 | } |
nothing calls this directly
no test coverage detected