From 62961ef9313747547220502d7bdeb385ea49729a Mon Sep 17 00:00:00 2001 From: Mark Wotton Date: Mon, 21 Mar 2016 12:34:38 -0400 Subject: [PATCH] fix exception test --- yesod-test/test/main.hs | 8 +++++--- yesod-test/yesod-test.cabal | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/yesod-test/test/main.hs b/yesod-test/test/main.hs index f7808bc0..c9271df7 100644 --- a/yesod-test/test/main.hs +++ b/yesod-test/test/main.hs @@ -21,7 +21,7 @@ import Control.Applicative import Network.Wai (pathInfo, requestHeaders) import Data.Maybe (fromMaybe) import Data.Either (isLeft) -import Control.Monad.Catch (try) +import Control.Exception.Lifted(try, SomeException) import Data.ByteString.Lazy.Char8 () import qualified Data.Map as Map @@ -234,9 +234,11 @@ main = hspec $ do yit "throws an exception when no redirect was returned" $ do get ("/" :: Text) statusIs 200 - r <- followRedirect + -- This appears to be an HUnitFailure, which is not + -- exported, so I'm catching SomeException instead. + (r :: Either SomeException ()) <- try followRedirect statusIs 200 - -- assertBool "expected exception" $ isLeft r + liftIO $ assertBool "expected exception" $ isLeft r instance RenderMessage LiteApp FormMessage where renderMessage _ _ = defaultFormMessage diff --git a/yesod-test/yesod-test.cabal b/yesod-test/yesod-test.cabal index f0c607f6..9f2ee0da 100644 --- a/yesod-test/yesod-test.cabal +++ b/yesod-test/yesod-test.cabal @@ -60,7 +60,7 @@ test-suite test , yesod-form , text , wai - , exceptions + , lifted-base , http-types source-repository head