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/DirectorySpec.hs | |
Diffstat (limited to 'test/Sound/MusicDirTrans/DirectorySpec.hs')
| -rw-r--r-- | test/Sound/MusicDirTrans/DirectorySpec.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Sound/MusicDirTrans/DirectorySpec.hs b/test/Sound/MusicDirTrans/DirectorySpec.hs new file mode 100644 index 0000000..328f5df --- /dev/null +++ b/test/Sound/MusicDirTrans/DirectorySpec.hs @@ -0,0 +1,30 @@ +module Sound.MusicDirTrans.DirectorySpec + ( spec + ) +where + +import Test.Hspec +import Sound.MusicDirTrans +import Sound.MusicDirTrans.Test.Util + +spec :: Spec +spec = do + describe "getTracksInDir" $ do + it "should get the tracks in a directory" $ do + files <- getTracksInDir "audio-samples" + files `shouldBe` audioTracks + + describe "genArtistPathFromTracks" $ do + it "should get the tracks in a directory" $ do + ap <- genArtistPathFromTracks "audio-samples" + ap `shouldBe` metadataArtistPath + + describe "mkRevertArtistPath" $ do + it "should create the dir.orig.name.txt path" $ do + mkRevertArtistPath "/tmp/audio-samples" "audio-samples-revert" + `shouldBe` ArtistPath "/tmp/audio-samples" "" "//tmp/audio-samples-revert" + + describe "revertFile" $ do + it "should represent the filemane - dir.orig.name.txt" $ do + revertFile `shouldBe` "dir.orig.name.txt" + |
