From be2416787660140339428c30b8ee5bc2a4a3e796 Mon Sep 17 00:00:00 2001 From: Xavier Coulon Date: Sun, 2 Oct 2022 14:23:23 +0200 Subject: [PATCH] refactor(test): remove 'MatchDocumentFragmentGroups' matcher use 'MatchDocumentFragment' instead Signed-off-by: Xavier Coulon --- pkg/parser/attributes_test.go | 32 ++++---- pkg/parser/blank_line_test.go | 6 +- .../delimited_block_passthrough_test.go | 2 +- pkg/parser/document_processing.go | 2 +- .../document_processing_parse_fragments.go | 2 +- .../document_fragment_groups_matcher.go | 49 ------------ .../document_fragment_groups_matcher_test.go | 77 ------------------- testsupport/document_fragment_matcher.go | 2 +- testsupport/document_fragment_matcher_test.go | 2 +- testsupport/document_fragments_matcher.go | 8 +- .../document_fragments_matcher_test.go | 7 +- testsupport/document_matcher.go | 2 +- testsupport/document_matcher_test.go | 2 +- testsupport/html5_matcher.go | 2 +- testsupport/inline_elements_matcher.go | 2 +- testsupport/inline_elements_matcher_test.go | 2 +- ..._groups.go => parse_document_fragments.go} | 2 +- ...st.go => parse_document_fragments_test.go} | 0 testsupport/table_of_contents_matcher.go | 2 +- testsupport/table_of_contents_matcher_test.go | 2 +- 20 files changed, 39 insertions(+), 166 deletions(-) delete mode 100644 testsupport/document_fragment_groups_matcher.go delete mode 100644 testsupport/document_fragment_groups_matcher_test.go rename testsupport/{parse_document_fragment_groups.go => parse_document_fragments.go} (91%) rename testsupport/{parse_document_fragment_groups_test.go => parse_document_fragments_test.go} (100%) diff --git a/pkg/parser/attributes_test.go b/pkg/parser/attributes_test.go index 5f2f4b67..43066f2a 100644 --- a/pkg/parser/attributes_test.go +++ b/pkg/parser/attributes_test.go @@ -34,7 +34,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with empty alt and extra whitespace", func() { @@ -54,7 +54,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with empty positional parameters", func() { @@ -74,7 +74,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with empty first parameter, non-empty width", func() { @@ -97,7 +97,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with double quoted alt", func() { @@ -120,7 +120,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with double quoted alt and escaped double quotes", func() { @@ -143,7 +143,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with single quoted alt and escaped single quotes", func() { @@ -166,7 +166,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with double quoted alt and standalone backslash", func() { @@ -189,7 +189,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image with single quoted alt and standalone backslash", func() { @@ -212,7 +212,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image alt and named pair", func() { @@ -238,7 +238,7 @@ var _ = Describe("attributes", func() { } result, err := ParseDocumentFragments(source) Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDocumentFragmentGroups(expected)) + Expect(result).To(MatchDocumentFragments(expected)) }) It("block image alt, width, height, and named pair", func() { @@ -263,7 +263,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image alt, width, height, and named pair (spacing)", func() { @@ -290,7 +290,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("block image alt, width, height, and named pair embedded quote", func() { @@ -317,7 +317,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) @@ -350,7 +350,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section with attributes detached", func() { @@ -382,7 +382,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) @@ -410,7 +410,7 @@ var _ = Describe("attributes", func() { }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) }) diff --git a/pkg/parser/blank_line_test.go b/pkg/parser/blank_line_test.go index 6df204bd..56df7a4e 100644 --- a/pkg/parser/blank_line_test.go +++ b/pkg/parser/blank_line_test.go @@ -57,7 +57,7 @@ second paragraph` }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("blank line with spaces and tabs between 2 paragraphs and after second paragraph", func() { @@ -126,7 +126,7 @@ second paragraph }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("blank line with attributes", func() { @@ -136,7 +136,7 @@ second paragraph expected := []types.DocumentFragment{ // standalone attribute is ignored } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) diff --git a/pkg/parser/delimited_block_passthrough_test.go b/pkg/parser/delimited_block_passthrough_test.go index 725c986a..337c98ec 100644 --- a/pkg/parser/delimited_block_passthrough_test.go +++ b/pkg/parser/delimited_block_passthrough_test.go @@ -67,7 +67,7 @@ another paragraph` }, }, } - Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) diff --git a/pkg/parser/document_processing.go b/pkg/parser/document_processing.go index 38b8fcd0..acd86a1f 100644 --- a/pkg/parser/document_processing.go +++ b/pkg/parser/document_processing.go @@ -25,7 +25,7 @@ func ParseDocument(r io.Reader, config *configuration.Configuration, opts ...Opt CollectFootnotes(footnotes, done, ApplySubstitutions(NewParseContext(config, opts...), done, // needs to be before 'ArrangeLists' RefineFragments(NewParseContext(config, opts...), r, done, - ParseFragments(NewParseContext(config, opts...), r, done), + ParseDocumentFragments(NewParseContext(config, opts...), r, done), ), ), ), diff --git a/pkg/parser/document_processing_parse_fragments.go b/pkg/parser/document_processing_parse_fragments.go index b6951104..c90cfea1 100644 --- a/pkg/parser/document_processing_parse_fragments.go +++ b/pkg/parser/document_processing_parse_fragments.go @@ -9,7 +9,7 @@ import ( log "github.com/sirupsen/logrus" ) -func ParseFragments(ctx *ParseContext, source io.Reader, done <-chan interface{}) <-chan types.DocumentFragment { +func ParseDocumentFragments(ctx *ParseContext, source io.Reader, done <-chan interface{}) <-chan types.DocumentFragment { resultStream := make(chan types.DocumentFragment, bufferSize) go func() { defer close(resultStream) diff --git a/testsupport/document_fragment_groups_matcher.go b/testsupport/document_fragment_groups_matcher.go deleted file mode 100644 index 2a6ecb71..00000000 --- a/testsupport/document_fragment_groups_matcher.go +++ /dev/null @@ -1,49 +0,0 @@ -package testsupport - -import ( - "fmt" - "reflect" - - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/davecgh/go-spew/spew" - "github.com/google/go-cmp/cmp" - gomegatypes "github.com/onsi/gomega/types" - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" -) - -// MatchDocumentFragmentGroups a custom matcher to verify that a document matches the given expectation -// Similar to the standard `Equal` matcher, but display a diff when the values don't match -func MatchDocumentFragmentGroups(expected []types.DocumentFragment) gomegatypes.GomegaMatcher { - return &documentFragmentGroupsMatcher{ - expected: expected, - } -} - -type documentFragmentGroupsMatcher struct { - expected []types.DocumentFragment - diffs string -} - -func (m *documentFragmentGroupsMatcher) Match(actual interface{}) (success bool, err error) { - if _, ok := actual.([]types.DocumentFragment); !ok { - return false, errors.Errorf("MatchDocumentFragmentGroups matcher expects an array of types.DocumentFragment (actual: %T)", actual) - } - if !reflect.DeepEqual(m.expected, actual) { - if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("actual document fragments:\n%s", spew.Sdump(actual)) - log.Debugf("expected document fragments:\n%s", spew.Sdump(m.expected)) - } - m.diffs = cmp.Diff(spew.Sdump(m.expected), spew.Sdump(actual)) - return false, nil - } - return true, nil -} - -func (m *documentFragmentGroupsMatcher) FailureMessage(_ interface{}) (message string) { - return fmt.Sprintf("expected document fragments to match:\n%s", m.diffs) -} - -func (m *documentFragmentGroupsMatcher) NegatedFailureMessage(_ interface{}) (message string) { - return fmt.Sprintf("expected document fragments not to match:\n%s", m.diffs) -} diff --git a/testsupport/document_fragment_groups_matcher_test.go b/testsupport/document_fragment_groups_matcher_test.go deleted file mode 100644 index 53c3eaac..00000000 --- a/testsupport/document_fragment_groups_matcher_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package testsupport_test - -import ( - "fmt" - - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/bytesparadise/libasciidoc/testsupport" - "github.com/google/go-cmp/cmp" - - "github.com/davecgh/go-spew/spew" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" -) - -var _ = Describe("document fragment matcher", func() { - - // given - expected := []types.DocumentFragment{ - { - Elements: []interface{}{ - &types.RawLine{ - Content: "a paragraph.", - }, - }, - }, - } - matcher := testsupport.MatchDocumentFragmentGroups(expected) - - It("should match", func() { - // given - actual := []types.DocumentFragment{ - { - Elements: []interface{}{ - &types.RawLine{ - Content: "a paragraph.", - }, - }, - }, - } - // when - result, err := matcher.Match(actual) - // then - Expect(err).ToNot(HaveOccurred()) - Expect(result).To(BeTrue()) - }) - - It("should not match", func() { - // given - actual := []types.DocumentFragment{ - { - Elements: []interface{}{ - &types.RawLine{ - Content: "something else", - }, - }, - }, - } - // when - result, err := matcher.Match(actual) - // then - Expect(err).ToNot(HaveOccurred()) - Expect(result).To(BeFalse()) - diffs := cmp.Diff(spew.Sdump(expected), spew.Sdump(actual)) - Expect(matcher.FailureMessage(actual)).To(Equal(fmt.Sprintf("expected document fragments to match:\n%s", diffs))) - Expect(matcher.NegatedFailureMessage(actual)).To(Equal(fmt.Sprintf("expected document fragments not to match:\n%s", diffs))) - }) - - It("should return error when invalid type is input", func() { - // when - result, err := matcher.Match(1) - // then - Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchDocumentFragmentGroups matcher expects an array of types.DocumentFragment (actual: int)")) - Expect(result).To(BeFalse()) - }) - -}) diff --git a/testsupport/document_fragment_matcher.go b/testsupport/document_fragment_matcher.go index 4939a6be..4093765f 100644 --- a/testsupport/document_fragment_matcher.go +++ b/testsupport/document_fragment_matcher.go @@ -27,7 +27,7 @@ type documentFragmentMatcher struct { func (m *documentFragmentMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.(types.DocumentFragment); !ok { - return false, errors.Errorf("MatchDocumentFragment matcher expects a types.DocumentFragment (actual: %T)", actual) + return false, errors.Errorf("MatchDocumentFragment matcher expects a 'types.DocumentFragment' (actual: %T)", actual) } if diff := cmp.Diff(m.expected, actual, opts...); diff != "" { if log.IsLevelEnabled(log.DebugLevel) { diff --git a/testsupport/document_fragment_matcher_test.go b/testsupport/document_fragment_matcher_test.go index adf2eca8..79527faa 100644 --- a/testsupport/document_fragment_matcher_test.go +++ b/testsupport/document_fragment_matcher_test.go @@ -63,7 +63,7 @@ var _ = Describe("document fragments matcher", func() { result, err := matcher.Match(1) // then Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchDocumentFragment matcher expects a types.DocumentFragment (actual: int)")) + Expect(err.Error()).To(Equal("MatchDocumentFragment matcher expects a 'types.DocumentFragment' (actual: int)")) Expect(result).To(BeFalse()) }) diff --git a/testsupport/document_fragments_matcher.go b/testsupport/document_fragments_matcher.go index cde669af..a0de0bee 100644 --- a/testsupport/document_fragments_matcher.go +++ b/testsupport/document_fragments_matcher.go @@ -26,14 +26,14 @@ type documentFragmentsMatcher struct { func (m *documentFragmentsMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.([]types.DocumentFragment); !ok { - return false, errors.Errorf("MatchDocumentFragments matcher expects an array of types.DocumentFragment (actual: %T)", actual) + return false, errors.Errorf("MatchDocumentFragments matcher expects a '[]types.DocumentFragment' (actual: %T)", actual) } if diff := cmp.Diff(m.expected, actual, opts...); diff != "" { if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("actual raw document:\n%s", spew.Sdump(actual)) - log.Debugf("expected raw document:\n%s", spew.Sdump(m.expected)) + log.Debugf("actual document fragments:\n%s", spew.Sdump(actual)) + log.Debugf("expected document fragments:\n%s", spew.Sdump(m.expected)) } - m.diffs = cmp.Diff(spew.Sdump(m.expected), spew.Sdump(actual)) + m.diffs = diff return false, nil } return true, nil diff --git a/testsupport/document_fragments_matcher_test.go b/testsupport/document_fragments_matcher_test.go index 57d76cc0..1067e51a 100644 --- a/testsupport/document_fragments_matcher_test.go +++ b/testsupport/document_fragments_matcher_test.go @@ -7,12 +7,11 @@ import ( "github.com/bytesparadise/libasciidoc/testsupport" "github.com/google/go-cmp/cmp" - "github.com/davecgh/go-spew/spew" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) -var _ = Describe("document fragments matcher", func() { +var _ = Describe("document fragment matcher", func() { // given expected := []types.DocumentFragment{ @@ -60,7 +59,7 @@ var _ = Describe("document fragments matcher", func() { // then Expect(err).ToNot(HaveOccurred()) Expect(result).To(BeFalse()) - diffs := cmp.Diff(spew.Sdump(expected), spew.Sdump(actual)) + diffs := cmp.Diff(expected, actual) Expect(matcher.FailureMessage(actual)).To(Equal(fmt.Sprintf("expected document fragments to match:\n%s", diffs))) Expect(matcher.NegatedFailureMessage(actual)).To(Equal(fmt.Sprintf("expected document fragments not to match:\n%s", diffs))) }) @@ -70,7 +69,7 @@ var _ = Describe("document fragments matcher", func() { result, err := matcher.Match(1) // then Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchDocumentFragments matcher expects an array of types.DocumentFragment (actual: int)")) + Expect(err.Error()).To(Equal("MatchDocumentFragments matcher expects a '[]types.DocumentFragment' (actual: int)")) Expect(result).To(BeFalse()) }) diff --git a/testsupport/document_matcher.go b/testsupport/document_matcher.go index 7ddaeb30..6edcfe30 100644 --- a/testsupport/document_matcher.go +++ b/testsupport/document_matcher.go @@ -40,7 +40,7 @@ var opts = []cmp.Option{cmpopts.IgnoreUnexported( func (m *documentMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.(*types.Document); !ok { - return false, errors.Errorf("MatchDocument matcher expects a Document (actual: %T)", actual) + return false, errors.Errorf("MatchDocument matcher expects a 'types.Document' (actual: %T)", actual) } if diff := cmp.Diff(m.expected, actual, opts...); diff != "" { if log.IsLevelEnabled(log.DebugLevel) { diff --git a/testsupport/document_matcher_test.go b/testsupport/document_matcher_test.go index c60dd4ef..3d4bcf7c 100644 --- a/testsupport/document_matcher_test.go +++ b/testsupport/document_matcher_test.go @@ -75,7 +75,7 @@ var _ = Describe("document matcher", func() { result, err := matcher.Match(1) // then Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchDocument matcher expects a Document (actual: int)")) + Expect(err.Error()).To(Equal("MatchDocument matcher expects a 'types.Document' (actual: int)")) Expect(result).To(BeFalse()) }) diff --git a/testsupport/html5_matcher.go b/testsupport/html5_matcher.go index 51dc9416..238becd6 100644 --- a/testsupport/html5_matcher.go +++ b/testsupport/html5_matcher.go @@ -163,7 +163,7 @@ type htmlTemplateFileMatcher struct { func (m *htmlTemplateFileMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.(string); !ok { - return false, errors.Errorf("MatchHTMLTemplate matcher expects a string (actual: %T)", actual) + return false, errors.Errorf("MatchHTMLTemplate matcher expects a 'string' (actual: %T)", actual) } expected, err := os.ReadFile(m.filename) diff --git a/testsupport/inline_elements_matcher.go b/testsupport/inline_elements_matcher.go index 2490a1f3..e358f8c7 100644 --- a/testsupport/inline_elements_matcher.go +++ b/testsupport/inline_elements_matcher.go @@ -25,7 +25,7 @@ type inlineElementsMatcher struct { func (m *inlineElementsMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.([]interface{}); !ok { - return false, errors.Errorf("MatchInlineElements matcher expects a []interface{} (actual: %T)", actual) + return false, errors.Errorf("MatchInlineElements matcher expects a '[]interface{}' (actual: %T)", actual) } if !reflect.DeepEqual(m.expected, actual) { m.diffs = cmp.Diff(spew.Sdump(m.expected), spew.Sdump(actual)) diff --git a/testsupport/inline_elements_matcher_test.go b/testsupport/inline_elements_matcher_test.go index ce32cb9d..2143d725 100644 --- a/testsupport/inline_elements_matcher_test.go +++ b/testsupport/inline_elements_matcher_test.go @@ -58,7 +58,7 @@ var _ = Describe("inline elements matcher", func() { result, err := matcher.Match(1) // then Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchInlineElements matcher expects a []interface{} (actual: int)")) + Expect(err.Error()).To(Equal("MatchInlineElements matcher expects a '[]interface{}' (actual: int)")) Expect(result).To(BeFalse()) }) diff --git a/testsupport/parse_document_fragment_groups.go b/testsupport/parse_document_fragments.go similarity index 91% rename from testsupport/parse_document_fragment_groups.go rename to testsupport/parse_document_fragments.go index 3c7471d4..d960df16 100644 --- a/testsupport/parse_document_fragment_groups.go +++ b/testsupport/parse_document_fragments.go @@ -15,7 +15,7 @@ func ParseDocumentFragments(actual string, options ...parser.Option) ([]types.Do done := make(chan interface{}) defer close(done) // ctx.Opts = append(ctx.Opts, parser.Debug(true)) - fragmentStream := parser.ParseFragments(ctx, r, done) + fragmentStream := parser.ParseDocumentFragments(ctx, r, done) result := []types.DocumentFragment{} for f := range fragmentStream { result = append(result, f) diff --git a/testsupport/parse_document_fragment_groups_test.go b/testsupport/parse_document_fragments_test.go similarity index 100% rename from testsupport/parse_document_fragment_groups_test.go rename to testsupport/parse_document_fragments_test.go diff --git a/testsupport/table_of_contents_matcher.go b/testsupport/table_of_contents_matcher.go index 103d66d0..e4af3568 100644 --- a/testsupport/table_of_contents_matcher.go +++ b/testsupport/table_of_contents_matcher.go @@ -26,7 +26,7 @@ type tableOfContentsMatcher struct { func (m *tableOfContentsMatcher) Match(actual interface{}) (success bool, err error) { if _, ok := actual.(*types.TableOfContents); !ok { - return false, errors.Errorf("MatchDocumentFragment matcher expects a *types.TableOfContents (actual: %T)", actual) + return false, errors.Errorf("MatchDocumentFragment matcher expects a '*types.TableOfContents' (actual: %T)", actual) } if diff := cmp.Diff(m.expected, actual, opts...); diff != "" { if log.IsLevelEnabled(log.DebugLevel) { diff --git a/testsupport/table_of_contents_matcher_test.go b/testsupport/table_of_contents_matcher_test.go index e41e7feb..d534fbe1 100644 --- a/testsupport/table_of_contents_matcher_test.go +++ b/testsupport/table_of_contents_matcher_test.go @@ -64,7 +64,7 @@ var _ = Describe("document fragments matcher", func() { result, err := matcher.Match(1) // then Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal("MatchDocumentFragment matcher expects a *types.TableOfContents (actual: int)")) + Expect(err.Error()).To(Equal("MatchDocumentFragment matcher expects a '*types.TableOfContents' (actual: int)")) Expect(result).To(BeFalse()) })