Refactor file type functions

This commit is contained in:
Deluan
2022-12-23 11:32:39 -05:00
committed by Deluan Quintão
parent 9ec349dce0
commit 8c1cd9c273
10 changed files with 75 additions and 98 deletions
-16
View File
@@ -1,27 +1,11 @@
package model_test
import (
"path/filepath"
"github.com/navidrome/navidrome/model"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("IsValidPlaylist()", func() {
It("returns true for a M3U file", func() {
Expect(model.IsValidPlaylist(filepath.Join("path", "to", "test.m3u"))).To(BeTrue())
})
It("returns true for a M3U8 file", func() {
Expect(model.IsValidPlaylist(filepath.Join("path", "to", "test.m3u8"))).To(BeTrue())
})
It("returns false for a non-playlist file", func() {
Expect(model.IsValidPlaylist("testm3u")).To(BeFalse())
})
})
var _ = Describe("Playlist", func() {
Describe("ToM3U8()", func() {
var pls model.Playlist