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 /langs/i18n | |
parent | 6027ee11082d0b9d72de1d4d1980a702be294ad2 (diff) |
tests: Convert from testify to quicktest
Diffstat (limited to 'langs/i18n')
-rw-r--r-- | langs/i18n/i18n_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/langs/i18n/i18n_test.go b/langs/i18n/i18n_test.go index e08210848..d9215952a 100644 --- a/langs/i18n/i18n_test.go +++ b/langs/i18n/i18n_test.go @@ -29,9 +29,9 @@ import ( "github.com/gohugoio/hugo/deps" + qt "github.com/frankban/quicktest" "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/hugofs" - "github.com/stretchr/testify/require" ) var logger = loggers.NewErrorLogger() @@ -179,19 +179,19 @@ func doTestI18nTranslate(t testing.TB, test i18nTest, cfg config.Provider) strin } func prepareTranslationProvider(t testing.TB, test i18nTest, cfg config.Provider) *TranslationProvider { - assert := require.New(t) + c := qt.New(t) fs := hugofs.NewMem(cfg) for file, content := range test.data { err := afero.WriteFile(fs.Source, filepath.Join("i18n", file), []byte(content), 0755) - assert.NoError(err) + c.Assert(err, qt.IsNil) } tp := NewTranslationProvider() depsCfg := newDepsConfig(tp, cfg, fs) d, err := deps.New(depsCfg) - assert.NoError(err) - assert.NoError(d.LoadResources()) + c.Assert(err, qt.IsNil) + c.Assert(d.LoadResources(), qt.IsNil) return tp } @@ -233,6 +233,7 @@ func getConfig() *viper.Viper { } func TestI18nTranslate(t *testing.T) { + c := qt.New(t) var actual, expected string v := getConfig() @@ -247,7 +248,7 @@ func TestI18nTranslate(t *testing.T) { expected = test.expected } actual = doTestI18nTranslate(t, test, v) - require.Equal(t, expected, actual) + c.Assert(actual, qt.Equals, expected) } } } |