JSPF loves export

This commit is contained in:
Philipp Wolfer 2023-11-14 00:39:17 +01:00
parent dcb5e9c2c6
commit 1f2d5f662d
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
4 changed files with 131 additions and 0 deletions

View file

@ -21,3 +21,21 @@ THE SOFTWARE.
*/
package jspf_test
import (
"testing"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"go.uploadedlobster.com/scotty/backends/scrobblerlog"
)
func TestFromConfig(t *testing.T) {
config := viper.New()
config.Set("file-path", "/foo/bar.jspf")
config.Set("title", "My Playlist")
config.Set("username", "outsidecontext")
config.Set("identifier", "http://example.com/playlist1")
backend := scrobblerlog.ScrobblerLogBackend{}.FromConfig(config)
assert.IsType(t, scrobblerlog.ScrobblerLogBackend{}, backend)
}