Skip to content

Commit

Permalink
refactor(test): remove HTML5ElementMatcher in favor of HTML5BodyMatch…
Browse files Browse the repository at this point in the history
…er (#431)

Fixes #430

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Oct 27, 2019
1 parent 5bc6ab4 commit a8f8ac7
Show file tree
Hide file tree
Showing 30 changed files with 337 additions and 440 deletions.
8 changes: 4 additions & 4 deletions pkg/renderer/html5/blank_line_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ second paragraph`
<div class="paragraph">
<p>second paragraph</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("blank line with spaces and tabs between 2 paragraphs", func() {
Expand All @@ -32,7 +32,7 @@ second paragraph`
<div class="paragraph">
<p>second paragraph</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("blank lines (tabs) at end of document", func() {
Expand All @@ -43,7 +43,7 @@ second paragraph`
expected := `<div class="paragraph">
<p>first paragraph</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("blank lines (spaces) at end of document", func() {
Expand All @@ -54,6 +54,6 @@ second paragraph`
expected := `<div class="paragraph">
<p>first paragraph</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})
})
10 changes: 5 additions & 5 deletions pkg/renderer/html5/comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ var _ = Describe("comments", func() {
It("single line comment alone", func() {
source := `// A single-line comment.`
expected := ""
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("single line comment at end of line", func() {
source := `foo // A single-line comment.`
expected := `<div class="paragraph">
<p>foo // A single-line comment.</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("single line comment within a paragraph", func() {
Expand All @@ -33,7 +33,7 @@ another line`
<p>a first line
another line</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})
})

Expand All @@ -45,7 +45,7 @@ a *comment* block
with multiple lines
////`
expected := ""
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("comment block with paragraphs around", func() {
Expand All @@ -61,7 +61,7 @@ a second paragraph`
<div class="paragraph">
<p>a second paragraph</p>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})
})

Expand Down
6 changes: 3 additions & 3 deletions pkg/renderer/html5/cross_reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ with some content linked to <<thetitle>>!`
</div>
</div>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("cross-reference with custom id and label", func() {
Expand All @@ -41,7 +41,7 @@ with some content linked to <<thetitle,a label to the title>>!`
</div>
</div>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})

It("invalid section reference", func() {
Expand All @@ -58,7 +58,7 @@ with some content linked to <<thewrongtitle>>!`
</div>
</div>
</div>`
Expect(source).To(RenderHTML5Element(expected))
Expect(source).To(RenderHTML5Body(expected))
})
})
})
Loading

0 comments on commit a8f8ac7

Please sign in to comment.