summaryrefslogtreecommitdiffstats
path: root/hugolib/integrationtest_builder.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-30 11:26:29 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-30 18:52:34 +0200
commitfbb8eb39ecda4151e1f50355688071c67f8bbcf1 (patch)
treef1148914a743bbd4fd16c4a42e4c09165e067422 /hugolib/integrationtest_builder.go
parent87d9bffe7402fabb8e91cc8c2b48e01e830aeb36 (diff)
Fix so temporary images do not get published
Fixes #10255
Diffstat (limited to 'hugolib/integrationtest_builder.go')
-rw-r--r--hugolib/integrationtest_builder.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go
index 6a5cd1ce3..c06c9d25f 100644
--- a/hugolib/integrationtest_builder.go
+++ b/hugolib/integrationtest_builder.go
@@ -137,6 +137,24 @@ func (s *IntegrationTestBuilder) AssertBuildCountTranslations(count int) {
s.Assert(s.H.init.translations.InitCount(), qt.Equals, count)
}
+func (s *IntegrationTestBuilder) AssertFileCount(dirname string, expected int) {
+ s.Helper()
+ fs := s.fs.WorkingDirReadOnly
+ count := 0
+ afero.Walk(fs, dirname, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+ if info.IsDir() {
+ return nil
+ }
+ count++
+ return nil
+ })
+ s.Assert(count, qt.Equals, expected)
+
+}
+
func (s *IntegrationTestBuilder) AssertFileContent(filename string, matches ...string) {
s.Helper()
content := strings.TrimSpace(s.FileContent(filename))