diff --git a/pkg/integration/components/file_system.go b/pkg/integration/components/file_system.go index feea9a5b1..194125ec6 100644 --- a/pkg/integration/components/file_system.go +++ b/pkg/integration/components/file_system.go @@ -10,23 +10,25 @@ type FileSystem struct { } // This does _not_ check the files panel, it actually checks the filesystem -func (self *FileSystem) PathPresent(path string) { +func (self *FileSystem) PathPresent(path string) *FileSystem { self.assertWithRetries(func() (bool, string) { _, err := os.Stat(path) return err == nil, fmt.Sprintf("Expected path '%s' to exist, but it does not", path) }) + return self } // This does _not_ check the files panel, it actually checks the filesystem -func (self *FileSystem) PathNotPresent(path string) { +func (self *FileSystem) PathNotPresent(path string) *FileSystem { self.assertWithRetries(func() (bool, string) { _, err := os.Stat(path) return os.IsNotExist(err), fmt.Sprintf("Expected path '%s' to not exist, but it does", path) }) + return self } // Asserts that the file at the given path has the given content -func (self *FileSystem) FileContent(path string, matcher *TextMatcher) { +func (self *FileSystem) FileContent(path string, matcher *TextMatcher) *FileSystem { self.assertWithRetries(func() (bool, string) { _, err := os.Stat(path) if os.IsNotExist(err) { @@ -46,4 +48,5 @@ func (self *FileSystem) FileContent(path string, matcher *TextMatcher) { return true, "" }) + return self }