(t *testing.T)
| 1205 | } |
| 1206 | |
| 1207 | func Test_apiRun_DELETE(t *testing.T) { |
| 1208 | ios, _, _, _ := iostreams.Test() |
| 1209 | |
| 1210 | var gotRequest *http.Request |
| 1211 | err := apiRun(&ApiOptions{ |
| 1212 | IO: ios, |
| 1213 | Config: func() (gh.Config, error) { |
| 1214 | return config.NewBlankConfig(), nil |
| 1215 | }, |
| 1216 | HttpClient: func() (*http.Client, error) { |
| 1217 | var tr roundTripper = func(req *http.Request) (*http.Response, error) { |
| 1218 | gotRequest = req |
| 1219 | return &http.Response{StatusCode: 204, Request: req}, nil |
| 1220 | } |
| 1221 | return &http.Client{Transport: tr}, nil |
| 1222 | }, |
| 1223 | MagicFields: []string(nil), |
| 1224 | RawFields: []string(nil), |
| 1225 | RequestMethod: "DELETE", |
| 1226 | RequestMethodPassed: true, |
| 1227 | }) |
| 1228 | if err != nil { |
| 1229 | t.Fatalf("got error %v", err) |
| 1230 | } |
| 1231 | |
| 1232 | if gotRequest.Body != nil { |
| 1233 | t.Errorf("expected nil request body, got %T", gotRequest.Body) |
| 1234 | } |
| 1235 | } |
| 1236 | |
| 1237 | func Test_apiRun_HEAD(t *testing.T) { |
| 1238 | ios, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected