summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Network/KRPCSpec.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/Network/KRPCSpec.hs b/tests/Network/KRPCSpec.hs
index 7f5b2794..e73b1ec0 100644
--- a/tests/Network/KRPCSpec.hs
+++ b/tests/Network/KRPCSpec.hs
@@ -20,18 +20,21 @@ handlers =
20instance MonadLogger IO where 20instance MonadLogger IO where
21 monadLoggerLog _ _ _ _ = return () 21 monadLoggerLog _ _ _ _ = return ()
22 22
23opts :: Options
24opts = def { optQueryTimeout = 1 }
25
23spec :: Spec 26spec :: Spec
24spec = do 27spec = do
25 describe "query" $ do 28 describe "query" $ do
26 it "run handlers" $ do 29 it "run handlers" $ do
27 let int = 0xabcd :: Int 30 let int = 0xabcd :: Int
28 (withManager servAddr handlers $ runReaderT $ do 31 (withManager opts servAddr handlers $ runReaderT $ do
29 listen 32 listen
30 query servAddr (Echo int)) 33 query servAddr (Echo int))
31 `shouldReturn` Echo int 34 `shouldReturn` Echo int
32 35
33 it "throw timeout exception" $ do 36 it "throw timeout exception" $ do
34 (withManager servAddr handlers $ runReaderT $ do 37 (withManager opts servAddr handlers $ runReaderT $ do
35 query servAddr (Echo (0xabcd :: Int)) 38 query servAddr (Echo (0xabcd :: Int))
36 ) 39 )
37 `shouldThrow` (== KError GenericError "timeout expired" "0") 40 `shouldThrow` (== KError GenericError "timeout expired" "0")