diff options
Diffstat (limited to 'Biz/Devalloc.hs')
-rw-r--r-- | Biz/Devalloc.hs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs index f0d8883..2333cac 100644 --- a/Biz/Devalloc.hs +++ b/Biz/Devalloc.hs @@ -389,7 +389,11 @@ test_upsertGitHubUser load = [ Test.unit "userId is not mempty" <| do (_, _, k) <- load Right User {..} <- upsertGitHubUser k "token" ghUser - userId @?!= mempty + userId @?!= mempty, + Test.unit "creates user when email is empty" <| do + (_, _, k) <- load + Right User {..} <- upsertGitHubUser k "token" ghUser {GitHub.userEmail = Nothing} + userEmail @?!= UserEmail Nothing ] where ghUser = @@ -440,7 +444,11 @@ Usage: |] move :: Cli.Arguments -> IO () -move _ = Exception.bracket startup shutdown run +move args = + Exception.bracket + (startup <| args `Cli.has` Cli.longOption "quiet") + shutdown + run startup :: IO (Config, Application, Acid.AcidState Keep) startup = do @@ -490,8 +498,14 @@ test = Test.group "Biz.Devalloc" [ test_calculateScore, - Test.with startup (\t@(c, _, _) -> shutdown t >> tidy c) test_upsertGitHubUser, - Test.with startup (\t@(c, _, _) -> shutdown t >> tidy c) test_analyzeGitHub + Test.with + (startup True) + (\t@(c, _, _) -> shutdown t >> tidy c) + test_upsertGitHubUser, + Test.with + (startup True) + (\t@(c, _, _) -> shutdown t >> tidy c) + test_analyzeGitHub ] -- * app configurations |