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 /commands/list_test.go | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) | |
download | hugo-9e571827055dedb46b78c5db3d17d6913f14870b.tar.gz hugo-9e571827055dedb46b78c5db3d17d6913f14870b.zip |
tests: Convert from testify to quicktest
Diffstat (limited to 'commands/list_test.go')
-rw-r--r-- | commands/list_test.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/commands/list_test.go b/commands/list_test.go index 55a067444..bfc280679 100644 --- a/commands/list_test.go +++ b/commands/list_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" + qt "github.com/frankban/quicktest" "github.com/spf13/cobra" - "github.com/stretchr/testify/require" ) func captureStdout(f func() (*cobra.Command, error)) (string, error) { @@ -33,10 +33,10 @@ func captureStdout(f func() (*cobra.Command, error)) (string, error) { } func TestListAll(t *testing.T) { - assert := require.New(t) + c := qt.New(t) dir, err := createSimpleTestSite(t, testSiteConfig{}) - assert.NoError(err) + c.Assert(err, qt.IsNil) hugoCmd := newCommandsBuilder().addAll().build() cmd := hugoCmd.getCommand() @@ -48,24 +48,25 @@ func TestListAll(t *testing.T) { cmd.SetArgs([]string{"-s=" + dir, "list", "all"}) out, err := captureStdout(cmd.ExecuteC) - assert.NoError(err) + c.Assert(err, qt.IsNil) r := csv.NewReader(strings.NewReader(out)) header, err := r.Read() - assert.NoError(err) - assert.Equal([]string{ + c.Assert(err, qt.IsNil) + c.Assert(header, qt.DeepEquals, []string{ "path", "slug", "title", "date", "expiryDate", "publishDate", "draft", "permalink", - }, header) + }) record, err := r.Read() - assert.NoError(err) - assert.Equal([]string{ + + c.Assert(err, qt.IsNil) + c.Assert(record, qt.DeepEquals, []string{ filepath.Join("content", "p1.md"), "", "P1", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "false", "https://example.org/p1/", - }, record) + }) } |