aboutsummaryrefslogtreecommitdiff
path: root/test/Sound/MusicDirTrans/FileSpec.hs
blob: 37f885103936a497533bab853521bf0dddda8b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Sound.MusicDirTrans.FileSpec
        ( spec
        )
where

import           Test.Hspec
import           Sound.MusicDirTrans
import           Sound.MusicDirTrans.Test.Util

spec :: Spec
spec = do
        describe "trackFilePatterns" $ do
                it "should compile track file extensions patterns" $ do
                        trackFilePatterns `shouldBe` patterns

        describe "getMetadata" $ do
                it "should gather track metadata" $ do
                        fileMetadata <- getMetadata "audio-samples/sample.flac"
                        sampleMetadata `shouldBe` fileMetadata

        describe "mkNewPathName" $ do
                it "should create an Artist -> Album ArtistPath structure" $ do
                        mkArtistPath origPath metadata `shouldBe` artistPath
                        mkArtistPath origPath metadataWithoutYear
                                `shouldBe` artistPathWithoutYear