-
-
Notifications
You must be signed in to change notification settings - Fork 300
Open
Description
Probably I'm missing something obvious from the docs but say I have two slices of structs that I want to compare but only on one field.
I want to write something like:
Expect(actual).To(HaveExactElements(
expected,
gstruct.MatchFields(gstruct.IgnoreExtra, Fields{"FieldName": Equal}),
))But the values in Fields have to be already instantiated matchers. But what do I call Equal(??) with?
or something like
Expect(actual).To(HaveExactElements(expected, EqualOnFields("FieldName")))I can see that HaveExactElements dynamically creates its default Equal() matcher from the expected elements but it wants a given custom matcher to already exist.
This is ultimately so painful because it's so painful to map values in go but it feels like this is something Gomega is in a good position to solve.
Metadata
Metadata
Assignees
Labels
No labels