Skip to content

Commit

Permalink
Update test in case keeping msg is desired
Browse files Browse the repository at this point in the history
  • Loading branch information
antonincms authored and onsi committed Jan 18, 2024
1 parent e0dd999 commit ad1a367
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions matchers/be_comparable_to_matcher_test.go
Expand Up @@ -138,12 +138,12 @@ var _ = Describe("BeComparableTo", func() {
Exported string
}

It("should produce failure message according to paseed cmp.Option", func() {
It("should produce failure message according to passed cmp.Option", func() {
actual := structWithUnexportedFields{unexported: "xxx", Exported: "exported field value"}
expectedEqual := structWithUnexportedFields{unexported: "yyy", Exported: "exported field value"}
matcherWithEqual := BeComparableTo(expectedEqual, cmpopts.IgnoreUnexported(structWithUnexportedFields{}))

Expect(matcherWithEqual.FailureMessage(actual)).To(BeEmpty())
Expect(matcherWithEqual.FailureMessage(actual)).To(BeEquivalentTo("Expected object to be comparable, diff: "))

expectedDiffernt := structWithUnexportedFields{unexported: "xxx", Exported: "other value"}
matcherWithDifference := BeComparableTo(expectedDiffernt, cmpopts.IgnoreUnexported(structWithUnexportedFields{}))
Expand Down

0 comments on commit ad1a367

Please sign in to comment.