(t *testing.T)
| 1285 | } |
| 1286 | |
| 1287 | func Test_apiRun_DELETE(t *testing.T) { |
| 1288 | ios, _, _, _ := iostreams.Test() |
| 1289 | |
| 1290 | var gotRequest *http.Request |
| 1291 | err := apiRun(&ApiOptions{ |
| 1292 | IO: ios, |
| 1293 | Config: func() (gh.Config, error) { |
| 1294 | return config.NewBlankConfig(), nil |
| 1295 | }, |
| 1296 | HttpClient: func() (*http.Client, error) { |
| 1297 | var tr roundTripper = func(req *http.Request) (*http.Response, error) { |
| 1298 | gotRequest = req |
| 1299 | return &http.Response{StatusCode: 204, Request: req}, nil |
| 1300 | } |
| 1301 | return &http.Client{Transport: tr}, nil |
| 1302 | }, |
| 1303 | MagicFields: []string(nil), |
| 1304 | RawFields: []string(nil), |
| 1305 | RequestMethod: "DELETE", |
| 1306 | RequestMethodPassed: true, |
| 1307 | }) |
| 1308 | if err != nil { |
| 1309 | t.Fatalf("got error %v", err) |
| 1310 | } |
| 1311 | |
| 1312 | if gotRequest.Body != nil { |
| 1313 | t.Errorf("expected nil request body, got %T", gotRequest.Body) |
| 1314 | } |
| 1315 | } |
| 1316 | |
| 1317 | func Test_apiRun_HEAD(t *testing.T) { |
| 1318 | ios, _, _, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected