Skip to content

Commit bac53ac

Browse files
authored
Use variadic arguments in ProtoSliceContains (#24)
1 parent de79d87 commit bac53ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

matchers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func (matcher *ProtoSliceContainsMatcher) NegatedFailureMessage(actual interface
248248
// Expect(items).To(ProtoSliceContains(expected)) // Passes
249249
// missing := []proto.Message{&v1.Foo{Bar: "test1"}}
250250
// Expect(missing).ToNot(ProtoSliceContains(expected)) // Passes
251-
func ProtoSliceContains(elements []proto.Message) types.GomegaMatcher {
251+
func ProtoSliceContains(elements ...proto.Message) types.GomegaMatcher {
252252
return &ProtoSliceContainsMatcher{
253253
Elements: elements,
254254
}

matchers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,9 @@ func TestProtoSliceContainsMatcher(t *testing.T) {
480480
for _, tc := range testCases {
481481
t.Run(tc.name, func(t *testing.T) {
482482
if tc.shouldMatch {
483-
g.Expect(tc.actual).To(matchers.ProtoSliceContains(tc.elements))
483+
g.Expect(tc.actual).To(matchers.ProtoSliceContains(tc.elements...))
484484
} else {
485-
g.Expect(tc.actual).ToNot(matchers.ProtoSliceContains(tc.elements))
485+
g.Expect(tc.actual).ToNot(matchers.ProtoSliceContains(tc.elements...))
486486
}
487487
})
488488
}

0 commit comments

Comments
 (0)