From 6dc35dc455680f697ba682805ba4a799a0d9dcec Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Wed, 8 Mar 2017 11:10:57 -0800 Subject: [PATCH] Update gitmon fail status spec --- src/GitmonClient.hs | 2 +- test/GitmonClientSpec.hs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/GitmonClient.hs b/src/GitmonClient.hs index 497e80e7c..767024b49 100644 --- a/src/GitmonClient.hs +++ b/src/GitmonClient.hs @@ -92,7 +92,7 @@ reportGitmon' SocketFactory{..} program gitCommand = do _ -> gitCommand throwGitmonException :: ByteString -> e - throwGitmonException command = throw . GitmonException . unpack $ "Received from Gitmon: '" <> decodeUtf8 command <> "' from Gitmon" + throwGitmonException command = throw . GitmonException . unpack $ "Received: '" <> decodeUtf8 command <> "' from Gitmon" collectStats :: IO (TimeSpec, ProcInfo) collectStats = do diff --git a/test/GitmonClientSpec.hs b/test/GitmonClientSpec.hs index 2c71198e3..0dac0f93e 100644 --- a/test/GitmonClientSpec.hs +++ b/test/GitmonClientSpec.hs @@ -79,7 +79,10 @@ spec = parallel $ do liftIO $ sendAll server "fail too busy" object <- parseObjOid (pack "dfac8fd681b0749af137aebf3203e77a06fbafc2") - liftIO $ shouldThrow (runReaderT (reportGitmon' socketFactory "cat-file" (lookupCommit object)) repo) anyErrorCall + liftIO $ shouldThrow (runReaderT (reportGitmon' socketFactory "cat-file" (lookupCommit object)) repo) gitmonException + +gitmonException :: GitmonException -> Bool +gitmonException = const True withSocketPair :: ((Socket, Socket, SocketFactory) -> IO c) -> IO c withSocketPair = bracket create release