summaryrefslogtreecommitdiffstats
path: root/hugolib/robotstxt_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-03-17 19:24:02 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-03-18 09:54:32 +0100
commitda88015776645cc68b96e8b94030c95905df53ae (patch)
tree8de419b68d715f03c097c97a2140f1869e40b5e3 /hugolib/robotstxt_test.go
parentdebd3663dd0a4dacf7dff01e2e602e58a4fa8ee7 (diff)
Spring test cleaning, take 2
Diffstat (limited to 'hugolib/robotstxt_test.go')
-rw-r--r--hugolib/robotstxt_test.go16
1 files changed, 6 insertions, 10 deletions
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")
}