diff options
author | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-08-16 13:10:38 +0100 |
---|---|---|
committer | Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> | 2014-08-16 13:10:38 +0100 |
commit | 4ebd950f3f61dcc7f8287a3f9d1dcf44b9bfeac8 (patch) | |
tree | 2bd98dafc208910bcd1ee3b8c0956674287e19d8 /tests/Network | |
parent | a70c08ee48908ed7c43e38d529baa641434f2792 (diff) |
Disambiguate KRPC instance inside spec
Diffstat (limited to 'tests/Network')
-rw-r--r-- | tests/Network/KRPCSpec.hs | 9 |
1 files changed, 6 insertions, 3 deletions
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 } | |||
25 | 25 | ||
26 | spec :: Spec | 26 | spec :: Spec |
27 | spec = do | 27 | spec = do |
28 | let qr :: MonadKRPC h m => SockAddr -> Echo Int -> m (Echo Int) | ||
29 | qr = query | ||
30 | |||
28 | describe "manager" $ do | 31 | describe "manager" $ do |
29 | it "is active until closeManager called" $ do | 32 | it "is active until closeManager called" $ do |
30 | m <- newManager opts servAddr [] | 33 | m <- newManager opts servAddr [] |
@@ -43,14 +46,14 @@ spec = do | |||
43 | it "count transactions properly" $ do | 46 | it "count transactions properly" $ do |
44 | (withManager opts servAddr handlers $ runReaderT $ do | 47 | (withManager opts servAddr handlers $ runReaderT $ do |
45 | listen | 48 | listen |
46 | _ <- query servAddr (Echo (0xabcd :: Int)) | 49 | _ <- qr servAddr (Echo 0xabcd) |
47 | _ <- query servAddr (Echo (0xabcd :: Int)) | 50 | _ <- qr servAddr (Echo 0xabcd) |
48 | getQueryCount | 51 | getQueryCount |
49 | ) | 52 | ) |
50 | `shouldReturn` 2 | 53 | `shouldReturn` 2 |
51 | 54 | ||
52 | it "throw timeout exception" $ do | 55 | it "throw timeout exception" $ do |
53 | (withManager opts servAddr handlers $ runReaderT $ do | 56 | (withManager opts servAddr handlers $ runReaderT $ do |
54 | query servAddr (Echo (0xabcd :: Int)) | 57 | qr servAddr (Echo 0xabcd) |
55 | ) | 58 | ) |
56 | `shouldThrow` (== TimeoutExpired) | 59 | `shouldThrow` (== TimeoutExpired) |