aboutsummaryrefslogtreecommitdiff
path: root/test/Sound/MusicDirTrans/TypeSpec.hs
blob: d825539a40997ca6d282ce0ac6b8c8be2797fdf8 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module Sound.MusicDirTrans.TypeSpec
        (
          spec
        )
where

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

spec :: Spec
spec = do
        describe "AudioTrack" $ do
                it "should work with the show function" $ do
                        show $ AudioTrack "Mono/Requiem for Hell (2019)/01-song.flac"
                        `shouldBe` "AudioTrack {currentPath = \"Mono/Requiem for Hell (2019)/01-song.flac\"}"
                it "should have an equivalency" $ do
                  AudioTrack "Mono/Requiem for Hell (2019)/01-song.flac"
                    == AudioTrack "Mono/Requiem for Hell (2019)/01-song.flac"
                  `shouldBe` True
                it "should have currentPath field accessible" $do
                  currentPath (AudioTrack "Mono/Requiem for Hell (2019)/01-song.flac")
                    `shouldBe` "Mono/Requiem for Hell (2019)/01-song.flac"

        describe "ArtistPath" $ do
                it "should work with the show function" $ do
                        show artistPath
                        `shouldBe` artistPathStr
                it "should have an equivalency" $ do
                  artistPath == artistPath
                  `shouldBe` True
                it "should have rootPath field accessible" $ do
                  rootPath artistPath `shouldBe` origPath
                it "should have parentPath field accessible" $ do
                  parentPath artistPath `shouldBe` "Mono"
                it "should have childPath field accessible" $ do
                  childPath artistPath `shouldBe` "Requiem for Hell (2019)"

        describe "Metadata" $ do
                it "should work with the show function" $ do
                        show $ sampleMetadata
                        `shouldBe` sampleMetadataStr

        describe "newPath" $ do
                it "should create a concatenated filepath" $ do
                  newPath artistPath `shouldBe` "Mono/Requiem for Hell (2019)/"