diff options
Diffstat (limited to 'internal/app/app_stub_test.go')
| -rw-r--r-- | internal/app/app_stub_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/internal/app/app_stub_test.go b/internal/app/app_stub_test.go index 8d33cd15..fc0030b4 100644 --- a/internal/app/app_stub_test.go +++ b/internal/app/app_stub_test.go @@ -1,7 +1,9 @@ package app import ( + "bytes" "fmt" + "io" "io/fs" "log" "os/exec" @@ -52,12 +54,21 @@ func (k *stubNixOS) stat(name string) (fs.FileInfo, error) { case "/home/ophestra/.pulse-cookie": return stubFileInfoIsDir(true), nil case "/home/ophestra/xdg/config/pulse/cookie": - return stubFileInfoIsDir(false), nil + return stubFileInfoPulseCookie{false}, nil default: panic(fmt.Sprintf("attempted to stat unexpected path %q", name)) } } +func (k *stubNixOS) open(name string) (osFile, error) { + switch name { + case "/home/ophestra/xdg/config/pulse/cookie": + return stubOsFileReadCloser{io.NopCloser(bytes.NewReader(bytes.Repeat([]byte{0}, pulseCookieSizeMax)))}, nil + default: + panic(fmt.Sprintf("attempted to open unexpected path %q", name)) + } +} + func (k *stubNixOS) readdir(name string) ([]fs.DirEntry, error) { switch name { case "/": |
