git.iko.soy/typeable/bloodhound
on master help sign in
my god finally got doctests working
d87f734Chris Allen
bloodhound.cabal+1−1
@@ -9,7 +9,7 @@ author: Chris Allen
9maintainer: cma@bitemyapp.com
9maintainer: cma@bitemyapp.com
10copyright: 2014, Chris Allen
10copyright: 2014, Chris Allen
11category: Database, Search
11category: Database, Search
12−build-type: Simple
12+build-type: Custom
13cabal-version: >=1.10
13cabal-version: >=1.10
14
14
15source-repository head
15source-repository head
src/Database/Bloodhound/Client.hs+6−6
@@ -64,13 +64,14 @@ import Database.Bloodhound.Types
64-- >>> :set -XOverloadedStrings
64-- >>> :set -XOverloadedStrings
65-- >>> import Database.Bloodhound
65-- >>> import Database.Bloodhound
66-- >>> import Test.DocTest.Prop (assert)
66-- >>> import Test.DocTest.Prop (assert)
67−-- >>> error "blah"
68−-- no trailing slashes in servers, library handles building the path.
69-- >>> let testServer = (Server "http://localhost:9200")
67-- >>> let testServer = (Server "http://localhost:9200")
70-- >>> let testIndex = IndexName "twitter"
68-- >>> let testIndex = IndexName "twitter"
71-- >>> let testMapping = MappingName "tweet"
69-- >>> let testMapping = MappingName "tweet"
72−-- defaultIndexSettings is exported by Database.Bloodhound as well
73-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
70-- >>> 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
74
75
75mkShardCount :: Int -> Maybe ShardCount
76mkShardCount :: Int -> Maybe ShardCount
76mkShardCount n
77mkShardCount n
@@ -124,10 +125,9 @@ getStatus (Server server) = do
124
125
125-- | createIndex will create an index given a 'Server',
126-- | createIndex will create an index given a 'Server',
126-- 'IndexSettings', and an 'IndexName'
127-- 'IndexSettings', and an 'IndexName'
127−
128-- >>> response <- createIndex testServer defaultIndexSettings testIndex
128-- >>> response <- createIndex testServer defaultIndexSettings testIndex
129−-- >>> assert $ respIsTwoHunna response
129+-- >>> respIsTwoHunna response
130−-- >>> assert False
130+-- True
131createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
131createIndex :: Server -> IndexSettings -> IndexName -> IO Reply
132createIndex (Server server) indexSettings (IndexName indexName) =
132createIndex (Server server) indexSettings (IndexName indexName) =
133 put url body
133 put url body
src/Database/Bloodhound/Types.hs+2−2
@@ -212,13 +212,13 @@ import Database.Bloodhound.Types.Class
212-- $setup
212-- $setup
213-- >>> :set -XOverloadedStrings
213-- >>> :set -XOverloadedStrings
214-- >>> import Database.Bloodhound
214-- >>> import Database.Bloodhound
215−-- no trailing slashes in servers, library handles building the path.
216-- >>> let testServer = (Server "http://localhost:9200")
215-- >>> let testServer = (Server "http://localhost:9200")
217-- >>> let testIndex = IndexName "twitter"
216-- >>> let testIndex = IndexName "twitter"
218-- >>> let testMapping = MappingName "tweet"
217-- >>> let testMapping = MappingName "tweet"
218+-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
219
219
220-- defaultIndexSettings is exported by Database.Bloodhound as well
220-- 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.
222
222
223{-| 'Version' is embedded in 'Status' -}
223{-| 'Version' is embedded in 'Status' -}
224data Version = Version { number :: Text
224data Version = Version { number :: Text