1
1
mirror of https://github.com/qfpl/applied-fp-course.git synced 2024-11-30 02:14:01 +03:00

Tests weren't passing for level06

Tests now pass for level06

need more tests
This commit is contained in:
Sean Chalmers 2017-08-17 08:54:02 +10:00
parent 3f3ac5b108
commit e06eae6695

View File

@ -12,7 +12,7 @@ import qualified FirstApp.Conf as Conf
import qualified FirstApp.DB as DB
import qualified FirstApp.Main as Main
import qualified FirstApp.Types as Types
import qualified FirstApp.AppM as AppM
main :: IO ()
main = do
let dieWith m = print m >> Exit.exitFailure
@ -22,17 +22,16 @@ main = do
Left err -> dieWith err
Right (cfg,db) -> do
let app' = pure ( Main.app cfg db )
Right env -> do
let app' = pure ( Main.app env )
flushTopic =
-- Clean up and yell about our errors
fmap ( either dieWith pure . join ) .
-- Purge all of the comments for this topic for our tests
traverse ( DB.deleteTopic db )
traverse ( DB.deleteTopic (AppM.envDb env) )
-- We don't export the constructor so even for known values we have
-- to play by the rules. There is no - "Oh just this one time.", do
-- it right.
-- to play by the rules. There is no - "Oh just this one time.", do it right.
$ Types.mkTopic "fudge"
-- Run the tests with a DB topic flush between each spec