hugolib: Make an RST test optional

If no RST installed.
This commit is contained in:
Bjørn Erik Pedersen 2022-01-01 12:20:07 +01:00
parent 0671ef5593
commit d632dd7d74
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -25,6 +25,7 @@ import (
"github.com/gohugoio/hugo/htesting" "github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/markup/asciidocext" "github.com/gohugoio/hugo/markup/asciidocext"
"github.com/gohugoio/hugo/markup/rst"
"github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/config"
@ -376,7 +377,7 @@ func testAllMarkdownEnginesForPages(t *testing.T,
{"md", func() bool { return true }}, {"md", func() bool { return true }},
{"mmark", func() bool { return true }}, {"mmark", func() bool { return true }},
{"ad", func() bool { return asciidocext.Supports() }}, {"ad", func() bool { return asciidocext.Supports() }},
{"rst", func() bool { return true }}, {"rst", func() bool { return rst.Supports() }},
} }
for _, e := range engines { for _, e := range engines {
@ -385,7 +386,6 @@ func testAllMarkdownEnginesForPages(t *testing.T,
} }
t.Run(e.ext, func(t *testing.T) { t.Run(e.ext, func(t *testing.T) {
cfg, fs := newTestCfg(func(cfg config.Provider) error { cfg, fs := newTestCfg(func(cfg config.Provider) error {
for k, v := range settings { for k, v := range settings {
cfg.Set(k, v) cfg.Set(k, v)
@ -433,7 +433,6 @@ func testAllMarkdownEnginesForPages(t *testing.T,
b.Assert(home, qt.Not(qt.IsNil)) b.Assert(home, qt.Not(qt.IsNil))
b.Assert(home.File().Path(), qt.Equals, homePath) b.Assert(home.File().Path(), qt.Equals, homePath)
b.Assert(content(home), qt.Contains, "Home Page Content") b.Assert(content(home), qt.Contains, "Home Page Content")
}) })
} }