Skip to content

Commit

Permalink
Clean up ownerref tests (#258)
Browse files Browse the repository at this point in the history
In this commit I switch the test from using gomega to go comparison.

Change-Id: I45065e849ee44f2dbf8dd4d315029847afad8529

Co-authored-by: Tabatha Lewis <tabathal@google.com>
  • Loading branch information
tabbyl21 and tabbyl21 committed Sep 30, 2022
1 parent 894d97a commit 428f3d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion oracle/pkg/k8s/ownerref/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ go_test(
srcs = ["ownerref_test.go"],
embed = [":ownerref"],
deps = [
"@com_github_onsi_gomega//:gomega",
"@com_github_google_go_cmp//cmp",
"@io_k8s_api//apps/v1:apps",
"@io_k8s_api//core/v1:core",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
Expand Down
8 changes: 4 additions & 4 deletions oracle/pkg/k8s/ownerref/ownerref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ownerref
import (
"testing"

. "github.com/onsi/gomega"
"github.com/google/go-cmp/cmp"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -98,10 +98,10 @@ func TestAdd(t *testing.T) {
},
}

g := NewWithT(t)

for _, test := range testCases {
Add(test.controlled, test.owner, true, true)
g.Expect(test.controlled).To(Equal(test.expected))
if diff := cmp.Diff(test.controlled, test.expected); diff != "" {
t.Errorf("Add got unexpected result: want-, got+: %s\n", diff)
}
}
}

0 comments on commit 428f3d2

Please sign in to comment.