From c72953df05259b20a7fc87117aefbbe284a376a1 Mon Sep 17 00:00:00 2001 From: Carlos Sosa Date: Sat, 18 Apr 2020 20:08:00 -0700 Subject: Initial commit v0.1.0 --- test/Sound/MusicDirTrans/DirectorySpec.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/Sound/MusicDirTrans/DirectorySpec.hs (limited to 'test/Sound/MusicDirTrans/DirectorySpec.hs') 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" + -- cgit v1.3-2-g0d8e