diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-08-18 20:53:47 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-08-20 20:53:47 +0200 |
| commit | 1a788a62611fcb3b044f37880a68147989dc5e18 (patch) | |
| tree | 0abb6f89047c6f4e32143c04ac8de7c593337a5d /src/Test/Hspec | |
| parent | c60dd98fc5b5b8d3fb3d8f071db078ddb547c5cf (diff) | |
| download | graphql-1a788a62611fcb3b044f37880a68147989dc5e18.tar.gz | |
Loose monad condition on test methods
Diffstat (limited to 'src/Test/Hspec')
| -rw-r--r-- | src/Test/Hspec/GraphQL.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Test/Hspec/GraphQL.hs b/src/Test/Hspec/GraphQL.hs index 093685b..253b366 100644 --- a/src/Test/Hspec/GraphQL.hs +++ b/src/Test/Hspec/GraphQL.hs @@ -11,6 +11,7 @@ module Test.Hspec.GraphQL , shouldResolveTo ) where +import Control.Monad.Catch (MonadCatch) import qualified Data.Aeson as Aeson import qualified Data.HashMap.Strict as HashMap import Data.Text (Text) @@ -18,8 +19,8 @@ import Language.GraphQL.Error import Test.Hspec.Expectations (Expectation, expectationFailure, shouldBe, shouldNotSatisfy) -- | Asserts that a query resolves to some value. -shouldResolveTo - :: Either (ResponseEventStream IO Aeson.Value) Aeson.Object +shouldResolveTo :: MonadCatch m + => Either (ResponseEventStream m Aeson.Value) Aeson.Object -> Aeson.Object -> Expectation shouldResolveTo (Right actual) expected = actual `shouldBe` expected @@ -27,8 +28,8 @@ shouldResolveTo _ _ = expectationFailure "the query is expected to resolve to a value, but it resolved to an event stream" -- | Asserts that the response doesn't contain any errors. -shouldResolve - :: (Text -> IO (Either (ResponseEventStream IO Aeson.Value) Aeson.Object)) +shouldResolve :: MonadCatch m + => (Text -> IO (Either (ResponseEventStream m Aeson.Value) Aeson.Object)) -> Text -> Expectation shouldResolve executor query = do |
