mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
parent
87d9bffe74
commit
fbb8eb39ec
4 changed files with 83 additions and 49 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue