diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-10 21:05:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-12 13:26:32 +0200 |
commit | 9e571827055dedb46b78c5db3d17d6913f14870b (patch) | |
tree | f5f0108afe0c9385ff6dc27664943d9f719f57ad /hugolib/hugo_sites_multihost_test.go | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) |
tests: Convert from testify to quicktest
Diffstat (limited to 'hugolib/hugo_sites_multihost_test.go')
-rw-r--r-- | hugolib/hugo_sites_multihost_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/hugolib/hugo_sites_multihost_test.go b/hugolib/hugo_sites_multihost_test.go index 999d94559..a15e8cd43 100644 --- a/hugolib/hugo_sites_multihost_test.go +++ b/hugolib/hugo_sites_multihost_test.go @@ -5,13 +5,13 @@ import ( "github.com/gohugoio/hugo/resources/page" - "github.com/stretchr/testify/require" + qt "github.com/frankban/quicktest" ) func TestMultihosts(t *testing.T) { t.Parallel() - assert := require.New(t) + c := qt.New(t) var configTemplate = ` paginate = 1 @@ -58,9 +58,9 @@ languageName = "Nynorsk" s1 := b.H.Sites[0] s1h := s1.getPage(page.KindHome) - assert.True(s1h.IsTranslated()) - assert.Len(s1h.Translations(), 2) - assert.Equal("https://example.com/docs/", s1h.Permalink()) + c.Assert(s1h.IsTranslated(), qt.Equals, true) + c.Assert(len(s1h.Translations()), qt.Equals, 2) + c.Assert(s1h.Permalink(), qt.Equals, "https://example.com/docs/") // For “regular multilingual” we kept the aliases pages with url in front matter // as a literal value that we use as is. @@ -69,8 +69,8 @@ languageName = "Nynorsk" // // check url in front matter: pageWithURLInFrontMatter := s1.getPage(page.KindPage, "sect/doc3.en.md") - assert.NotNil(pageWithURLInFrontMatter) - assert.Equal("/docs/superbob/", pageWithURLInFrontMatter.RelPermalink()) + c.Assert(pageWithURLInFrontMatter, qt.Not(qt.IsNil)) + c.Assert(pageWithURLInFrontMatter.RelPermalink(), qt.Equals, "/docs/superbob/") b.AssertFileContent("public/en/superbob/index.html", "doc3|Hello|en") // check alias: @@ -80,7 +80,7 @@ languageName = "Nynorsk" s2 := b.H.Sites[1] s2h := s2.getPage(page.KindHome) - assert.Equal("https://example.fr/", s2h.Permalink()) + c.Assert(s2h.Permalink(), qt.Equals, "https://example.fr/") b.AssertFileContent("public/fr/index.html", "French Home Page", "String Resource: /docs/text/pipes.txt") b.AssertFileContent("public/fr/text/pipes.txt", "Hugo Pipes") @@ -96,17 +96,17 @@ languageName = "Nynorsk" // Check bundles bundleEn := s1.getPage(page.KindPage, "bundles/b1/index.en.md") - require.NotNil(t, bundleEn) - require.Equal(t, "/docs/bundles/b1/", bundleEn.RelPermalink()) - require.Equal(t, 1, len(bundleEn.Resources())) + c.Assert(bundleEn, qt.Not(qt.IsNil)) + c.Assert(bundleEn.RelPermalink(), qt.Equals, "/docs/bundles/b1/") + c.Assert(len(bundleEn.Resources()), qt.Equals, 1) b.AssertFileContent("public/en/bundles/b1/logo.png", "PNG Data") b.AssertFileContent("public/en/bundles/b1/index.html", " image/png: /docs/bundles/b1/logo.png") bundleFr := s2.getPage(page.KindPage, "bundles/b1/index.md") - require.NotNil(t, bundleFr) - require.Equal(t, "/bundles/b1/", bundleFr.RelPermalink()) - require.Equal(t, 1, len(bundleFr.Resources())) + c.Assert(bundleFr, qt.Not(qt.IsNil)) + c.Assert(bundleFr.RelPermalink(), qt.Equals, "/bundles/b1/") + c.Assert(len(bundleFr.Resources()), qt.Equals, 1) b.AssertFileContent("public/fr/bundles/b1/logo.png", "PNG Data") b.AssertFileContent("public/fr/bundles/b1/index.html", " image/png: /bundles/b1/logo.png") |