The latest version of hspec-pg-transact is 0.1.0.3-0.
hspec-pg-transact
Version 0.1.0.1 revision 0 uploaded by JonathanFischoff.
Package meta
- 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
utilizestmp-postgres
to automatically and connect to a temporary instance ofpostgres
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
wrapsdescribe
with abeforeAll
hook for creating a db and aafterAll
hook for stopping a db.Tests can be written with
itDB
which is wrapper aroundit
that uses the passed inConnection
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.
- Author
- Jonathan Fischoff
- Bug reports
- n/a
- Category
- Web
- Copyright
- 2017 Jonathan Fischoff
- Homepage
- https://github.com/jfischoff/hspec-pg-transact#readme
- Maintainer
- jonathangfischoff@gmail.com
- Package URL
- n/a
- Stability
- n/a