Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hedgehog state machine #48

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hspec-wai.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ library
, base-compat
, bytestring >=0.10
, case-insensitive
, exceptions >=0.1.1 && <1
, hspec-core ==2.*
, hspec-expectations >=0.8.0
, http-types
Expand Down Expand Up @@ -67,6 +68,7 @@ test-suite spec
, base-compat
, bytestring >=0.10
, case-insensitive
, exceptions >=0.1.1 && <1
, hspec
, hspec-core ==2.*
, hspec-expectations >=0.8.0
Expand Down
1 change: 1 addition & 0 deletions src/Test/Hspec/Wai.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module Test.Hspec.Wai (
, with
, pending
, pendingWith
, runWaiSession
) where

import Data.Foldable
Expand Down
4 changes: 2 additions & 2 deletions src/Test/Hspec/Wai/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module Test.Hspec.Wai.Internal (
WaiExpectation
Expand All @@ -14,6 +13,7 @@ module Test.Hspec.Wai.Internal (
import Prelude ()
import Prelude.Compat

import Control.Monad.Catch (MonadCatch, MonadThrow)
import Control.Monad.IO.Class
import Control.Monad.Trans.Reader
import Network.Wai (Application)
Expand All @@ -29,7 +29,7 @@ type WaiExpectation = WaiSession ()
-- | A <http://www.yesodweb.com/book/web-application-interface WAI> test
-- session that carries the `Application` under test and some client state.
newtype WaiSession a = WaiSession {unWaiSession :: Session a}
deriving (Functor, Applicative, Monad, MonadIO)
deriving (Functor, Applicative, Monad, MonadIO, MonadThrow, MonadCatch)

runWaiSession :: WaiSession a -> Application -> IO a
runWaiSession = runSession . unWaiSession
Expand Down