Remove duplicated fscache creation

This commit is contained in:
Deluan
2020-04-09 13:15:01 -04:00
parent 5265d0234f
commit 2d39a6df8d
6 changed files with 74 additions and 43 deletions
+30
View File
@@ -0,0 +1,30 @@
package engine
import (
"io/ioutil"
"os"
"path/filepath"
"github.com/deluan/navidrome/conf"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("File Caches", func() {
BeforeEach(func() {
conf.Server.DataFolder, _ = ioutil.TempDir("", "file_caches")
})
AfterEach(func() {
os.RemoveAll(conf.Server.DataFolder)
})
Describe("newFileCache", func() {
It("creates the cache folder", func() {
_, err := newFileCache("test", "1kb", "test", 10)
Expect(err).To(BeNil())
_, err = os.Stat(filepath.Join(conf.Server.DataFolder, "test"))
Expect(os.IsNotExist(err)).To(BeFalse())
})
})
})