From 4ebd950f3f61dcc7f8287a3f9d1dcf44b9bfeac8 Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Sat, 16 Aug 2014 13:10:38 +0100 Subject: Disambiguate KRPC instance inside spec --- tests/Network/KRPCSpec.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/Network/KRPCSpec.hs b/tests/Network/KRPCSpec.hs index 0a6dc8fb..eabcc817 100644 --- a/tests/Network/KRPCSpec.hs +++ b/tests/Network/KRPCSpec.hs @@ -25,6 +25,9 @@ opts = def { optQueryTimeout = 1 } spec :: Spec spec = do + let qr :: MonadKRPC h m => SockAddr -> Echo Int -> m (Echo Int) + qr = query + describe "manager" $ do it "is active until closeManager called" $ do m <- newManager opts servAddr [] @@ -43,14 +46,14 @@ spec = do it "count transactions properly" $ do (withManager opts servAddr handlers $ runReaderT $ do listen - _ <- query servAddr (Echo (0xabcd :: Int)) - _ <- query servAddr (Echo (0xabcd :: Int)) + _ <- qr servAddr (Echo 0xabcd) + _ <- qr servAddr (Echo 0xabcd) getQueryCount ) `shouldReturn` 2 it "throw timeout exception" $ do (withManager opts servAddr handlers $ runReaderT $ do - query servAddr (Echo (0xabcd :: Int)) + qr servAddr (Echo 0xabcd) ) `shouldThrow` (== TimeoutExpired) -- cgit v1.2.3