(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestGitignoresService_List(t *testing.T) { |
| 17 | t.Parallel() |
| 18 | client, mux, _ := setup(t) |
| 19 | |
| 20 | mux.HandleFunc("/gitignore/templates", func(w http.ResponseWriter, r *http.Request) { |
| 21 | testMethod(t, r, "GET") |
| 22 | fmt.Fprint(w, `["C", "Go"]`) |
| 23 | }) |
| 24 | |
| 25 | ctx := t.Context() |
| 26 | available, _, err := client.Gitignores.List(ctx) |
| 27 | if err != nil { |
| 28 | t.Errorf("Gitignores.List returned error: %v", err) |
| 29 | } |
| 30 | |
| 31 | want := []string{"C", "Go"} |
| 32 | if !cmp.Equal(available, want) { |
| 33 | t.Errorf("Gitignores.List returned %+v, want %+v", available, want) |
| 34 | } |
| 35 | |
| 36 | const methodName = "List" |
| 37 | testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { |
| 38 | got, resp, err := client.Gitignores.List(ctx) |
| 39 | if got != nil { |
| 40 | t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) |
| 41 | } |
| 42 | return resp, err |
| 43 | }) |
| 44 | } |
| 45 | |
| 46 | func TestGitignoresService_Get(t *testing.T) { |
| 47 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…