Yesod.Internal.TestApi exports internals for tests
This commit is contained in:
parent
f925fa28ec
commit
4ed740724e
@ -5,10 +5,9 @@ module Yesod.Internal.Request
|
||||
, Request (..)
|
||||
, RequestBodyContents
|
||||
, FileInfo (..)
|
||||
#ifdef TEST
|
||||
-- The below are exported for testing.
|
||||
, randomString
|
||||
, parseWaiRequest'
|
||||
#endif
|
||||
) where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
@ -41,8 +40,7 @@ parseWaiRequest :: W.Request
|
||||
-> [(Text, Text)] -- ^ session
|
||||
-> Maybe a
|
||||
-> IO Request
|
||||
parseWaiRequest env session' key' = parseWaiRequest' env session' key'
|
||||
<$> newStdGen
|
||||
parseWaiRequest env session' key' = parseWaiRequest' env session' key' <$> newStdGen
|
||||
|
||||
parseWaiRequest' :: RandomGen g
|
||||
=> W.Request
|
||||
|
||||
10
yesod-core/Yesod/Internal/TestApi.hs
Normal file
10
yesod-core/Yesod/Internal/TestApi.hs
Normal file
@ -0,0 +1,10 @@
|
||||
--
|
||||
-- | WARNING: This module exposes internal interfaces solely for the
|
||||
-- purpose of facilitating unit testing with cabal install. Library
|
||||
-- users should not import this module.
|
||||
--
|
||||
module Yesod.Internal.TestApi
|
||||
( Request (..), randomString, parseWaiRequest'
|
||||
) where
|
||||
|
||||
import Yesod.Internal.Request (Request (..), randomString, parseWaiRequest')
|
||||
@ -6,13 +6,15 @@ import Test.Widget
|
||||
import Test.Media
|
||||
import Test.Links
|
||||
import Test.NoOverloadedStrings
|
||||
import Test.InternalRequest
|
||||
|
||||
main :: IO ()
|
||||
main = hspecX $ descriptions $
|
||||
main = hspecX $ descriptions $
|
||||
[ cleanPathTest
|
||||
, exceptionsTest
|
||||
, widgetTest
|
||||
, mediaTest
|
||||
, linksTest
|
||||
, noOverloadedTest
|
||||
, internalRequestTest
|
||||
]
|
||||
|
||||
@ -65,6 +65,7 @@ library
|
||||
Yesod.Request
|
||||
Yesod.Widget
|
||||
Yesod.Message
|
||||
Yesod.Internal.TestApi
|
||||
other-modules: Yesod.Internal
|
||||
Yesod.Internal.Core
|
||||
Yesod.Internal.Session
|
||||
@ -101,6 +102,7 @@ test-suite runtests
|
||||
,shakespeare-js
|
||||
,text
|
||||
,http-types
|
||||
, random
|
||||
,HUnit
|
||||
,QuickCheck >= 2 && < 3
|
||||
ghc-options: -Wall
|
||||
|
||||
Loading…
Reference in New Issue
Block a user