package storage import ( "testing" "github.com/spf13/afero" "github.com/stretchr/testify/assert" ) func TestFileSystemStorageProvider(t *testing.T) { t.Run("Store method stores files in filesystem", func(t *testing.T) { fileSystem := afero.NewMemMapFs() dummyData := []byte{0x13, 0x37} provider := FileSystemStorageProvider{ fileSystem: fileSystem, basePath: "/tmp/foo/bar", } provider.store("test", "test.bin", dummyData) exists, _ := afero.Exists(fileSystem, "/tmp/foo/bar/test/test.bin") assert.True(t, exists) }) }