folderwatcher/folderwatcher_notExistingFolder_test.go

23 lines
348 B
Go
Raw Permalink Normal View History

2024-10-28 11:20:58 +01:00
package folderwatcher
import (
"os"
"testing"
)
func TestNotExistingFolder(t *testing.T) {
tmpPath, err := os.MkdirTemp("", ".folderwatcher_test")
if err != nil {
t.Fatal(err)
}
_ = os.RemoveAll(tmpPath)
conf := Config{
Folder: tmpPath,
}
_, err = NewFolderWatcher(conf, true, nil)
if err == nil {
t.Fatal("expected error")
}
}