diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-08-10 21:05:17 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-08-12 13:26:32 +0200 |
commit | 9e571827055dedb46b78c5db3d17d6913f14870b (patch) | |
tree | f5f0108afe0c9385ff6dc27664943d9f719f57ad /helpers/content_test.go | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) | |
download | hugo-9e571827055dedb46b78c5db3d17d6913f14870b.tar.gz hugo-9e571827055dedb46b78c5db3d17d6913f14870b.zip |
tests: Convert from testify to quicktest
Diffstat (limited to 'helpers/content_test.go')
-rw-r--r-- | helpers/content_test.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/helpers/content_test.go b/helpers/content_test.go index 011d606e6..7500c2ac1 100644 --- a/helpers/content_test.go +++ b/helpers/content_test.go @@ -21,10 +21,9 @@ import ( "github.com/spf13/viper" + qt "github.com/frankban/quicktest" "github.com/miekg/mmark" "github.com/russross/blackfriday" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) const tstHTMLContent = "<!DOCTYPE html><html><head><script src=\"http://two/foobar.js\"></script></head><body><nav><ul><li hugo-nav=\"section_0\"></li><li hugo-nav=\"section_1\"></li></ul></nav><article>content <a href=\"http://two/foobar\">foobar</a>. Follow up</article><p>This is some text.<br>And some more.</p></body></html>" @@ -90,17 +89,19 @@ func BenchmarkStripHTML(b *testing.B) { } func TestStripEmptyNav(t *testing.T) { + c := qt.New(t) cleaned := stripEmptyNav([]byte("do<nav>\n</nav>\n\nbedobedo")) - assert.Equal(t, []byte("dobedobedo"), cleaned) + c.Assert(cleaned, qt.DeepEquals, []byte("dobedobedo")) } func TestBytesToHTML(t *testing.T) { - assert.Equal(t, template.HTML("dobedobedo"), BytesToHTML([]byte("dobedobedo"))) + c := qt.New(t) + c.Assert(BytesToHTML([]byte("dobedobedo")), qt.Equals, template.HTML("dobedobedo")) } func TestNewContentSpec(t *testing.T) { cfg := viper.New() - assert := require.New(t) + c := qt.New(t) cfg.Set("summaryLength", 32) cfg.Set("buildFuture", true) @@ -109,11 +110,11 @@ func TestNewContentSpec(t *testing.T) { spec, err := NewContentSpec(cfg) - assert.NoError(err) - assert.Equal(32, spec.summaryLength) - assert.True(spec.BuildFuture) - assert.True(spec.BuildExpired) - assert.True(spec.BuildDrafts) + c.Assert(err, qt.IsNil) + c.Assert(spec.summaryLength, qt.Equals, 32) + c.Assert(spec.BuildFuture, qt.Equals, true) + c.Assert(spec.BuildExpired, qt.Equals, true) + c.Assert(spec.BuildDrafts, qt.Equals, true) } |