Skip to content

Commit

Permalink
Add test for resource JSON marshaling (#2783)
Browse files Browse the repository at this point in the history
Relates to: #55.
  • Loading branch information
kldzj authored May 17, 2023
1 parent da7dd5e commit dff9dcc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions github/repos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3506,3 +3506,29 @@ func TestRequiredStatusCheck_Marshal(t *testing.T) {

testJSONMarshal(t, u, want)
}

func TestRepositoryTag_Marshal(t *testing.T) {
testJSONMarshal(t, &RepositoryTag{}, "{}")

u := &RepositoryTag{
Name: String("v0.1"),
Commit: &Commit{
SHA: String("sha"),
URL: String("url"),
},
ZipballURL: String("zball"),
TarballURL: String("tball"),
}

want := `{
"name": "v0.1",
"commit": {
"sha": "sha",
"url": "url"
},
"zipball_url": "zball",
"tarball_url": "tball"
}`

testJSONMarshal(t, u, want)
}

0 comments on commit dff9dcc

Please sign in to comment.