From c4c504189cef8db3782ca3dfa26e27f4124634de Mon Sep 17 00:00:00 2001 From: Marcus Kok Date: Fri, 5 Apr 2024 12:24:00 -0400 Subject: [PATCH] new memmapfs on tests --- test/link_test.go | 2 ++ test/status_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/link_test.go b/test/link_test.go index 337e8a2..657a83f 100644 --- a/test/link_test.go +++ b/test/link_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/Marcusk19/dotctl/cmd" + "github.com/spf13/afero" "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) @@ -15,6 +16,7 @@ import ( func TestLinkCommand(t *testing.T) { viper.Set("testing", true) + cmd.FileSystem = afero.NewMemMapFs() fs := cmd.FileSystem homedir := os.Getenv("HOME") diff --git a/test/status_test.go b/test/status_test.go index e004769..1eacf07 100644 --- a/test/status_test.go +++ b/test/status_test.go @@ -7,11 +7,13 @@ import ( "testing" "github.com/Marcusk19/dotctl/cmd" + "github.com/spf13/afero" "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) func TestStatusCommand(t *testing.T) { + cmd.FileSystem = afero.NewMemMapFs() viper.Set("testing", true) fs := cmd.FileSystem