From 24df88dd3e63024155d86ac3231ca2abbba3fc86 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Tue, 4 Feb 2014 18:16:14 +0400 Subject: Update tests --- tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs | 12 +++++++----- tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'tests/Network/BitTorrent/Tracker/RPC') diff --git a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs index eb549516..81c4fae0 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs @@ -24,11 +24,13 @@ spec = do context (show uri) $ do describe "announce" $ do it "have valid response" $ do - q <- arbitrarySample - info <- runResourceT $ connect uri >>= announce q - validateInfo q info + withManager def $ \ mgr -> do + q <- arbitrarySample + info <- runResourceT $ announce mgr uri q + validateInfo q info describe "scrape" $ do it "have valid response" $ do - xs <- runResourceT $ connect uri >>= scrape [def] - L.length xs `shouldSatisfy` (>= 1) + withManager def $ \ mgr -> do + xs <- runResourceT $ scrape mgr uri [def] + L.length xs `shouldSatisfy` (>= 1) diff --git a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs index e46f15b6..f3dcec88 100644 --- a/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs @@ -24,10 +24,12 @@ spec = do context (show uri) $ do describe "announce" $ do it "have valid response" $ do - q <- arbitrarySample - connect uri >>= announce q >>= validateInfo q + withManager def $ \ mgr -> do + q <- arbitrarySample + announce mgr uri q >>= validateInfo q describe "scrape" $ do it "have valid response" $ do - xs <- connect uri >>= scrape [def] - L.length xs `shouldSatisfy` (>= 1) + withManager def $ \ mgr -> do + xs <- scrape mgr uri [def] + L.length xs `shouldSatisfy` (>= 1) -- cgit v1.2.3