https://github.com/rubenv/redistest
Go library to spawn single-use Redis servers for unit testing
https://github.com/rubenv/redistest
go golang redis test
Last synced: about 2 months ago
JSON representation
Go library to spawn single-use Redis servers for unit testing
- Host: GitHub
- URL: https://github.com/rubenv/redistest
- Owner: rubenv
- License: mit
- Created: 2020-02-06T07:25:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T07:05:34.000Z (about 5 years ago)
- Last Synced: 2025-02-24T08:27:11.554Z (over 1 year ago)
- Topics: go, golang, redis, test
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redistest
> Go library to spawn single-use Redis servers for unit testing
[](https://github.com/rubenv/redistest/actions) [](https://travis-ci.org/rubenv/redistest) [](https://godoc.org/github.com/rubenv/redistest)
Spawns a Redis server. Ideal for unit tests where you want a clean instance
each time. Then clean up afterwards.
Features:
* Starts a clean isolated Redis database
* Tested on Fedora, Ubuntu and Alpine
* Optimized for in-memory execution, to speed up unit tests
* Less than 0.1 second startup / initialization time
## Usage
In your unit test:
```go
red, err := redistest.Start()
defer red.Stop()
// Do something with red.Pool (which is a *redis.Pool)
```
## License
This library is distributed under the [MIT](LICENSE) license.