Skip to content

Commit db639bc

Browse files
authored
Remove type assertion as no longer an interface (#147)
Fixes #144
1 parent 4130b29 commit db639bc

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/branchrestrictions_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ func TestCreateBranchRestrictionsKindPush(t *testing.T) {
4848
if err != nil {
4949
t.Error(err)
5050
}
51-
jsonMap := res.(map[string]interface{})
52-
if jsonMap["type"] != "branchrestriction" {
53-
t.Error("is not branchrestriction type")
54-
}
55-
if jsonMap["kind"] != "push" {
51+
if res.Kind != "push" {
5652
t.Error("did not match branchrestriction kind")
5753
}
5854
}
@@ -72,11 +68,7 @@ func TestCreateBranchRestrictionsKindRequirePassingBuilds(t *testing.T) {
7268
if err != nil {
7369
t.Error(err)
7470
}
75-
jsonMap := res.(map[string]interface{})
76-
if jsonMap["type"] != "branchrestriction" {
77-
t.Error("is not branchrestriction type")
78-
}
79-
if jsonMap["kind"] != "require_passing_builds_to_merge" {
71+
if res.Kind != "require_passing_builds_to_merge" {
8072
t.Error("did not match branchrestriction kind")
8173
}
8274
}

0 commit comments

Comments
 (0)