forked from jfischoff/pg-transact-hspec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hspec-pg-transact.cabal
53 lines (51 loc) · 1.82 KB
/
hspec-pg-transact.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: hspec-pg-transact
version: 0.1.0.2
synopsis: Helpers for creating database tests with hspec and pg-transact
description:
Helpers for creating database tests with hspec and pg-transact
.
@hspec-pg-transact@ utilizes @tmp-postgres@ to automatically and connect to a temporary instance of @postgres@ on a random port.
.
>
> describeDB migrate "Query” $
> itDB "work" $ do
> execute_ [sql|
> INSERT INTO things
> VALUES (‘me’) |]
> query_ [sql|
> SELECT name
> FROM things |]
> `shouldReturn` [Only "me"]
.
In the example above @describeDB@ wraps @describe@ with a @beforeAll@ hook for creating a db and a @afterAll@ hook for stopping a db.
.
Tests can be written with @itDB@ which is wrapper around @it@ that uses the passed in @Connection@ to run a db transaction automatically for the test.
.
The libary also provides a few other functions for more fine grained control over running transactions in tests.
.
homepage: https://github.com/jfischoff/pg-transact-hspec#readme
license: BSD3
license-file: LICENSE
author: Jonathan Fischoff
maintainer: jonathangfischoff@gmail.com
copyright: 2017 Jonathan Fischoff
category: Web
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
library
hs-source-dirs: src
exposed-modules: Test.Hspec.DB
build-depends: base >= 4.7 && < 5
, hspec
, tmp-postgres
, postgresql-simple
, pg-transact
, bytestring
, text
, resource-pool
default-language: Haskell2010
ghc-options: -Wall -Wno-unused-do-bind
source-repository head
type: git
location: https://github.com/jfischoff/pg-transact-hspec