Fixed iTunes location decoding

This commit is contained in:
Deluan
2016-03-12 11:28:59 -05:00
parent 4b09eeccc2
commit 4d7f9ee012
3 changed files with 34 additions and 2 deletions
+25
View File
@@ -0,0 +1,25 @@
package scanner
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestExtractLocation(t *testing.T) {
Convey("Given a path with a plus (+) signal", t, func() {
location := "file:///Users/deluan/Music/iTunes%201/iTunes%20Media/Music/Chance/Six%20Through%20Ten/03%20Forgive+Forget.m4a"
Convey("When I decode it", func() {
path := extractPath(location)
Convey("I get the correct path", func() {
So(path, ShouldEqual, "/Users/deluan/Music/iTunes 1/iTunes Media/Music/Chance/Six Through Ten/03 Forgive+Forget.m4a")
})
})
})
}