From ccd39bb8ae582e00f345b8a578853e2dcf23b136 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 18 Aug 2024 11:18:54 +0200 Subject: [PATCH] Fix wrong test assertion text If a `t.FileSystem().FileContent("file.txt", Equals("bla"))` assertion fails because the file doesn't exist, the error would say Expected path 'file.txt' to not exist, but it does which is very confusing. --- pkg/integration/components/file_system.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/integration/components/file_system.go b/pkg/integration/components/file_system.go index 74f179fdc..feea9a5b1 100644 --- a/pkg/integration/components/file_system.go +++ b/pkg/integration/components/file_system.go @@ -30,7 +30,7 @@ func (self *FileSystem) FileContent(path string, matcher *TextMatcher) { self.assertWithRetries(func() (bool, string) { _, err := os.Stat(path) if os.IsNotExist(err) { - return false, fmt.Sprintf("Expected path '%s' to not exist, but it does", path) + return false, fmt.Sprintf("Expected path '%s' to exist, but it does not", path) } output, err := os.ReadFile(path)