diff options
| author | Carlos Sosa <gnusosa@gnusosa.net> | 2020-04-18 20:08:00 -0700 |
|---|---|---|
| committer | Carlos Sosa <gnusosa@gnusosa.net> | 2020-04-23 09:21:02 -0700 |
| commit | c72953df05259b20a7fc87117aefbbe284a376a1 (patch) | |
| tree | 1a1515d0ada2adcc07e32095e841c8c2d4a0f982 /test/Sound/MusicDirTrans/TypeSpec.hs | |
Diffstat (limited to 'test/Sound/MusicDirTrans/TypeSpec.hs')
| -rw-r--r-- | test/Sound/MusicDirTrans/TypeSpec.hs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/Sound/MusicDirTrans/TypeSpec.hs b/test/Sound/MusicDirTrans/TypeSpec.hs new file mode 100644 index 0000000..d825539 --- /dev/null +++ b/test/Sound/MusicDirTrans/TypeSpec.hs @@ -0,0 +1,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)/" |
