hspec-pg-transact: Helpers for creating database tests with hspec and pg-transact
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.
[Skip to Readme]
Downloads
- hspec-pg-transact-0.1.0.3.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3 |
---|---|
Dependencies | base (>=4.7 && <5), bytestring, hspec, pg-transact, postgresql-simple, resource-pool, text, tmp-postgres [details] |
License | BSD-3-Clause |
Copyright | 2021 Jonathan Fischoff |
Author | Jonathan Fischoff |
Maintainer | jonathangfischoff@gmail.com |
Category | Web |
Home page | https://github.com/jfischoff/pg-transact-hspec#readme |
Source repo | head: git clone https://github.com/jfischoff/pg-transact-hspec |
Uploaded | by hecate at 2021-09-02T19:56:25Z |
Distributions | |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 2601 total (12 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] All reported builds failed as of 2021-09-02 [all 1 reports] |