Add scaffolding
This commit is contained in:
parent
d49b95b7b4
commit
4de8e8ffdc
38 changed files with 8807 additions and 2 deletions
31
test/TestImport.hs
Normal file
31
test/TestImport.hs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE NoImplicitPrelude #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
module TestImport
|
||||
( module TestImport
|
||||
, module X
|
||||
) where
|
||||
|
||||
import Application (makeFoundation, makeLogWare)
|
||||
import ClassyPrelude as X hiding (Handler)
|
||||
import Foundation as X
|
||||
import Test.Hspec as X
|
||||
import Yesod.Default.Config2 (useEnv, loadYamlSettings)
|
||||
import Yesod.Test as X
|
||||
import Yesod.Core.Unsafe (fakeHandlerGetLogger)
|
||||
|
||||
runHandler :: Handler a -> YesodExample App a
|
||||
runHandler handler = do
|
||||
app <- getTestYesod
|
||||
fakeHandlerGetLogger appLogger app handler
|
||||
|
||||
|
||||
withApp :: SpecWith (TestApp App) -> Spec
|
||||
withApp = before $ do
|
||||
settings <- loadYamlSettings
|
||||
["config/test-settings.yml", "config/settings.yml"]
|
||||
[]
|
||||
useEnv
|
||||
foundation <- makeFoundation settings
|
||||
logWare <- liftIO $ makeLogWare foundation
|
||||
return (foundation, logWare)
|
||||
Loading…
Add table
Add a link
Reference in a new issue