diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-04 18:16:14 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-04 18:16:14 +0400 |
commit | 24df88dd3e63024155d86ac3231ca2abbba3fc86 (patch) | |
tree | 562dc7b9c1833f69590016ccdf1d0283b55c5240 /tests/Network/BitTorrent/Tracker/RPC | |
parent | eaf426da786acf925a1786938c5ae2b1c9230a07 (diff) |
Update tests
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/RPC')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/HTTPSpec.hs | 12 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPC/UDPSpec.hs | 10 |
2 files changed, 13 insertions, 9 deletions
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 | |||
24 | context (show uri) $ do | 24 | context (show uri) $ do |
25 | describe "announce" $ do | 25 | describe "announce" $ do |
26 | it "have valid response" $ do | 26 | it "have valid response" $ do |
27 | q <- arbitrarySample | 27 | withManager def $ \ mgr -> do |
28 | info <- runResourceT $ connect uri >>= announce q | 28 | q <- arbitrarySample |
29 | validateInfo q info | 29 | info <- runResourceT $ announce mgr uri q |
30 | validateInfo q info | ||
30 | 31 | ||
31 | describe "scrape" $ do | 32 | describe "scrape" $ do |
32 | it "have valid response" $ do | 33 | it "have valid response" $ do |
33 | xs <- runResourceT $ connect uri >>= scrape [def] | 34 | withManager def $ \ mgr -> do |
34 | L.length xs `shouldSatisfy` (>= 1) | 35 | xs <- runResourceT $ scrape mgr uri [def] |
36 | 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 | |||
24 | context (show uri) $ do | 24 | context (show uri) $ do |
25 | describe "announce" $ do | 25 | describe "announce" $ do |
26 | it "have valid response" $ do | 26 | it "have valid response" $ do |
27 | q <- arbitrarySample | 27 | withManager def $ \ mgr -> do |
28 | connect uri >>= announce q >>= validateInfo q | 28 | q <- arbitrarySample |
29 | announce mgr uri q >>= validateInfo q | ||
29 | 30 | ||
30 | describe "scrape" $ do | 31 | describe "scrape" $ do |
31 | it "have valid response" $ do | 32 | it "have valid response" $ do |
32 | xs <- connect uri >>= scrape [def] | 33 | withManager def $ \ mgr -> do |
33 | L.length xs `shouldSatisfy` (>= 1) | 34 | xs <- scrape mgr uri [def] |
35 | L.length xs `shouldSatisfy` (>= 1) | ||