From da88015776645cc68b96e8b94030c95905df53ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 17 Mar 2018 19:24:02 +0100 Subject: Spring test cleaning, take 2 --- hugolib/robotstxt_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'hugolib/robotstxt_test.go') diff --git a/hugolib/robotstxt_test.go b/hugolib/robotstxt_test.go index 03332cbce..e924cb8dc 100644 --- a/hugolib/robotstxt_test.go +++ b/hugolib/robotstxt_test.go @@ -14,10 +14,9 @@ package hugolib import ( - "path/filepath" "testing" - "github.com/gohugoio/hugo/deps" + "github.com/spf13/viper" ) const robotTxtTemplate = `User-agent: Googlebot @@ -28,19 +27,16 @@ const robotTxtTemplate = `User-agent: Googlebot func TestRobotsTXTOutput(t *testing.T) { t.Parallel() - var ( - cfg, fs = newTestCfg() - th = testHelper{cfg, fs, t} - ) + cfg := viper.New() cfg.Set("baseURL", "http://auth/bub/") cfg.Set("enableRobotsTXT", true) - writeSource(t, fs, filepath.Join("layouts", "robots.txt"), robotTxtTemplate) - writeSourcesToSource(t, "content", fs, weightedSources...) + b := newTestSitesBuilder(t).WithViper(cfg) + b.WithTemplatesAdded("layouts/robots.txt", robotTxtTemplate) - buildSingleSite(t, deps.DepsCfg{Fs: fs, Cfg: cfg}, BuildCfg{}) + b.Build(BuildCfg{}) - th.assertFileContent("public/robots.txt", "User-agent: Googlebot") + b.AssertFileContent("public/robots.txt", "User-agent: Googlebot") } -- cgit v1.2.3