diff --git a/holy-project.cabal b/holy-project.cabal index 5603e73..05a6c13 100644 --- a/holy-project.cabal +++ b/holy-project.cabal @@ -57,6 +57,7 @@ executable holy-project library exposed-modules: HolyProject , HolyProject.StringUtils + , HolyProject.GithubAPI , HolyProject.Coconut -- other-modules: -- other-extensions: diff --git a/test/HolyProject/GithubAPI/Test.hs b/test/HolyProject/GithubAPI/Test.hs new file mode 100644 index 0000000..3b1875b --- /dev/null +++ b/test/HolyProject/GithubAPI/Test.hs @@ -0,0 +1,22 @@ +module HolyProject.GithubAPI.Test +( githubAPISuite +) where +import Test.Tasty (testGroup, TestTree) +import Test.Tasty.HUnit +import HolyProject.GithubAPI + +githubAPISuite :: TestTree +githubAPISuite = testGroup "GithubAPI" + [ testCase "Yann" + (ioTestEq + (searchGHUserFromEmail "Yann.Esposito@gmail.com") + (Just "\"yogsototh\"")) + , testCase "Jasper" + (ioTestEq + (searchGHUserFromEmail "Jasper Van der Jeugt") + (Just "\"jaspervdj\"")) + ] + +ioTestEq :: (Eq a, Show a) => IO a -> a -> Assertion +ioTestEq action expected = action >>= assertEqual "" expected + diff --git a/test/Test.hs b/test/Test.hs index ed6fd3c..93006a8 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -3,6 +3,7 @@ module Main where import Test.Tasty (defaultMain,testGroup,TestTree) import HolyProject.StringUtils.Test +import HolyProject.GithubAPI.Test import HolyProject.Coconut.Test main :: IO () @@ -11,5 +12,6 @@ main = defaultMain tests tests :: TestTree tests = testGroup "All Tests" [ stringUtilsSuite + , githubAPISuite , coconutSuite ]