diff options
Diffstat (limited to 'tests/Network/BitTorrent/Tracker/RPCSpec.hs')
-rw-r--r-- | tests/Network/BitTorrent/Tracker/RPCSpec.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Network/BitTorrent/Tracker/RPCSpec.hs b/tests/Network/BitTorrent/Tracker/RPCSpec.hs index b816a9ce..dfc13a1e 100644 --- a/tests/Network/BitTorrent/Tracker/RPCSpec.hs +++ b/tests/Network/BitTorrent/Tracker/RPCSpec.hs | |||
@@ -24,9 +24,9 @@ rpcOpts = def | |||
24 | { optUdpRPC = UDP.rpcOpts | 24 | { optUdpRPC = UDP.rpcOpts |
25 | } | 25 | } |
26 | 26 | ||
27 | isUnrecognizedProtocol :: String -> RpcException -> Bool | 27 | matchUnrecognizedScheme :: String -> RpcException -> Bool |
28 | isUnrecognizedProtocol x (UnrecognizedProtocol scheme) = x == scheme | 28 | matchUnrecognizedScheme x (UnrecognizedScheme scheme) = x == scheme |
29 | isUnrecognizedProtocol _ _ = False | 29 | matchUnrecognizedScheme _ _ = False |
30 | 30 | ||
31 | spec :: Spec | 31 | spec :: Spec |
32 | spec = parallel $ do | 32 | spec = parallel $ do |
@@ -46,13 +46,13 @@ spec = parallel $ do | |||
46 | withManager rpcOpts def $ \ mgr -> do | 46 | withManager rpcOpts def $ \ mgr -> do |
47 | q <- arbitrarySample | 47 | q <- arbitrarySample |
48 | announce mgr "magnet://foo.bar" q | 48 | announce mgr "magnet://foo.bar" q |
49 | `shouldThrow` isUnrecognizedProtocol "magnet:" | 49 | `shouldThrow` matchUnrecognizedScheme "magnet:" |
50 | 50 | ||
51 | describe "scrape" $ do | 51 | describe "scrape" $ do |
52 | it "must fail on bad uri scheme" $ do | 52 | it "must fail on bad uri scheme" $ do |
53 | withManager rpcOpts def $ \ mgr -> do | 53 | withManager rpcOpts def $ \ mgr -> do |
54 | scrape mgr "magnet://foo.bar" [] | 54 | scrape mgr "magnet://foo.bar" [] |
55 | `shouldThrow` isUnrecognizedProtocol "magnet:" | 55 | `shouldThrow` matchUnrecognizedScheme "magnet:" |
56 | 56 | ||
57 | forM_ trackers $ \ TrackerEntry {..} -> | 57 | forM_ trackers $ \ TrackerEntry {..} -> |
58 | context trackerName $ do | 58 | context trackerName $ do |