git.iko.soy/typeable/bloodhound
on master help sign in
my god finally got doctests working
commitd87f73410830f409471f406585ab5aa530fdf62d authorChris Allen <cma@bitemyapp.com> dateWed 10 Dec 2014, 15:38 (12 years ago) parentb5cf74d
3 files changed+9−9
bloodhound.cabal+1−1 src/Database/Bloodhound/Client.hs+6−6 src/Database/Bloodhound/Types.hs+2−2
bloodhound.cabal+1−1
@@ -9,7 +9,7 @@ author: Chris Allen
99maintainer: cma@bitemyapp.com
1010copyright: 2014, Chris Allen
1111category: Database, Search
12−build-type: Simple
12+build-type: Custom
1313cabal-version: >=1.10
1414
1515source-repository head
src/Database/Bloodhound/Client.hs+6−6
@@ -64,13 +64,14 @@ import Database.Bloodhound.Types
6464-- >>> :set -XOverloadedStrings
6565-- >>> import Database.Bloodhound
6666-- >>> import Test.DocTest.Prop (assert)
67−-- >>> error "blah"
68−-- no trailing slashes in servers, library handles building the path.
6967-- >>> let testServer = (Server "http://localhost:9200")
7068-- >>> let testIndex = IndexName "twitter"
7169-- >>> let testMapping = MappingName "tweet"
72−-- defaultIndexSettings is exported by Database.Bloodhound as well
7370-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
71+-- >>> _ <- deleteIndex testServer testIndex
72+
73+-- no trailing slashes in servers, library handles building the path.
74+-- defaultIndexSettings is exported by Database.Bloodhound as well
7475
7576mkShardCount :: Int -> Maybe ShardCount
7677mkShardCount n
@@ -124,10 +125,9 @@ getStatus (Server server) = do
124125
125126-- | createIndex will create an index given a 'Server',
126127-- 'IndexSettings', and an 'IndexName'
127−
128128-- >>> response <- createIndex testServer defaultIndexSettings testIndex
129−-- >>> assert $ respIsTwoHunna response
130−-- >>> assert False
129+-- >>> respIsTwoHunna response
130+-- True
131131createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
132132createIndex (Server server) indexSettings (IndexName indexName) =
133133 put url body
src/Database/Bloodhound/Types.hs+2−2
@@ -212,13 +212,13 @@ import Database.Bloodhound.Types.Class
212212-- $setup
213213-- >>> :set -XOverloadedStrings
214214-- >>> import Database.Bloodhound
215−-- no trailing slashes in servers, library handles building the path.
216215-- >>> let testServer = (Server "http://localhost:9200")
217216-- >>> let testIndex = IndexName "twitter"
218217-- >>> let testMapping = MappingName "tweet"
218+-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
219219
220220-- defaultIndexSettings is exported by Database.Bloodhound as well
221−-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
221+-- no trailing slashes in servers, library handles building the path.
222222
223223{-| 'Version' is embedded in 'Status' -}
224224data Version = Version { number :: Text