summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorLuka Markušić <luka.markusic@microblink.com>2022-08-03 14:06:12 +0200
committerLuka Markušić <luka.markusic@microblink.com>2022-08-03 14:06:12 +0200
commit6160d85d4f883f606a680f6bd03c63200c6d5bdb (patch)
treef182e9850fdd4e21882714cd04acfb56c8503e97 /pkg
parent64224e7caaad745f988c7e153f74a5b5bf2e5077 (diff)
Use tmpdir for tests
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/oscommands/os_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/commands/oscommands/os_test.go b/pkg/commands/oscommands/os_test.go
index 389fdfc8e..abbdc9068 100644
--- a/pkg/commands/oscommands/os_test.go
+++ b/pkg/commands/oscommands/os_test.go
@@ -3,6 +3,7 @@ package oscommands
import (
"io/ioutil"
"os"
+ "path/filepath"
"testing"
"github.com/stretchr/testify/assert"
@@ -145,7 +146,7 @@ func TestOSCommandAppendLineToFile(t *testing.T) {
scenarios := []scenario{
{
- "testFile",
+ filepath.Join(os.TempDir(), "testFile"),
func(path string) {
if err := ioutil.WriteFile(path, []byte("hello"), 0o600); err != nil {
panic(err)
@@ -153,7 +154,7 @@ func TestOSCommandAppendLineToFile(t *testing.T) {
},
},
{
- "testFileWithNewline",
+ filepath.Join(os.TempDir(), "testFileWithNewline"),
func(path string) {
if err := ioutil.WriteFile(path, []byte("hello\n"), 0o600); err != nil {
panic(err)