diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-04-03 00:58:59 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-04-03 00:58:59 +0400 |
commit | 35a049358dbc84f1b24e8e6d3f7e5e1dc0d5e0ae (patch) | |
tree | 3704c8118943db24c06d538b45531a25c13cb081 | |
parent | 14a90a6848b4fb39cd61459746ca8ea136adffb0 (diff) |
[Client] Add spec item for openMagnet
-rw-r--r-- | bittorrent.cabal | 1 | ||||
-rw-r--r-- | tests/Network/BitTorrent/Client/HandleSpec.hs | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/bittorrent.cabal b/bittorrent.cabal index 48e7a8cc..7058d704 100644 --- a/bittorrent.cabal +++ b/bittorrent.cabal | |||
@@ -190,6 +190,7 @@ test-suite spec | |||
190 | Data.Torrent.MetainfoSpec | 190 | Data.Torrent.MetainfoSpec |
191 | Data.Torrent.PieceSpec | 191 | Data.Torrent.PieceSpec |
192 | Data.Torrent.ProgressSpec | 192 | Data.Torrent.ProgressSpec |
193 | Network.BitTorrent.Client.HandleSpec | ||
193 | Network.BitTorrent.CoreSpec | 194 | Network.BitTorrent.CoreSpec |
194 | Network.BitTorrent.Core.FingerprintSpec | 195 | Network.BitTorrent.Core.FingerprintSpec |
195 | Network.BitTorrent.Core.NodeInfoSpec | 196 | Network.BitTorrent.Core.NodeInfoSpec |
diff --git a/tests/Network/BitTorrent/Client/HandleSpec.hs b/tests/Network/BitTorrent/Client/HandleSpec.hs new file mode 100644 index 00000000..8e16d9b0 --- /dev/null +++ b/tests/Network/BitTorrent/Client/HandleSpec.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | module Network.BitTorrent.Client.HandleSpec (spec) where | ||
2 | import Data.Default | ||
3 | import Test.Hspec | ||
4 | |||
5 | import Data.Torrent.Magnet | ||
6 | import Network.BitTorrent.Client | ||
7 | import Network.BitTorrent.Client.Handle | ||
8 | |||
9 | data_dir :: FilePath | ||
10 | data_dir = "data" | ||
11 | |||
12 | spec :: Spec | ||
13 | spec = do | ||
14 | describe "openMagnet" $ do | ||
15 | it "should add new infohash to index" $ do | ||
16 | simpleClient $ do | ||
17 | _ <- openMagnet data_dir (nullMagnet def) | ||
18 | _ <- getHandle def | ||
19 | return () | ||