From 17d15b7dcf367366b0d4497aeba0bac1e0c3ce94 Mon Sep 17 00:00:00 2001 From: sagar23sj Date: Mon, 12 Jul 2021 15:48:43 +0530 Subject: [PATCH] Resources Covered : Gitignore --- github/gitignore_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/github/gitignore_test.go b/github/gitignore_test.go index 2104aa4fa5e..61ee4d52e58 100644 --- a/github/gitignore_test.go +++ b/github/gitignore_test.go @@ -87,3 +87,19 @@ func TestGitignoresService_Get_invalidTemplate(t *testing.T) { _, _, err := client.Gitignores.Get(ctx, "%") testURLParseError(t, err) } + +func TestGitignore_Marshal(t *testing.T) { + testJSONMarshal(t, &Gitignore{}, "{}") + + u := &Gitignore{ + Name: String("name"), + Source: String("source"), + } + + want := `{ + "name": "name", + "source": "source" + }` + + testJSONMarshal(t, u, want) +}