We have released a new library Gemika Show archive.org snapshot to help test a gem against multiple versions of Ruby, gem dependencies and database types.
Here's what Gemika can give your test's development setup (all features are opt-in):
- Test one codebase against multiple sets of gem dependency sets (e.g. Rails 4.2, Rails 5.0).
- Test one codebase against multiple Ruby versions (e.g. Ruby 2.1.8, Ruby 2.3.1).
- Test one codebase against multiple database types (currently MySQL or PostgreSQL).
- Compute a matrix of all possible dependency permutations (Ruby, gem set, database type). Manually exclude incompatible dependency permutations (e.g. Rails 5.0 does not work with Ruby 2.1).
- Let developers enter their local credentials for MySQL and PostgreSQL in a
database.yml
file. - Define default Ruby version, gem dependencies and database for developers who don't care about every possible permutation for everyday work.
- Help configure a
Travis CI
Show archive.org snapshot
build that tests every dependency permutation after each
git push
. - Share your Ruby / gem dependeny / database permutation between local development and Travis CI.
- Define an ActiveRecord database migration Show archive.org snapshot that sets up your test database.
- Automatically drop and re-create your test database before each run of your test suite.
- Configure RSpec to wrap each example in a transaction that is rolled back when the example ends. This way each example starts with a blank database.
This is our preferred way of testing gems in the future. The old way (embedding multiple Rails applications) should be considered deprecated. We will migrate the test setup of existing gems to Gemika whenever we make larger changes to it.
Gemika is currently used in minidusen Show archive.org snapshot .
Posted by Henning Koch to makandra dev (2016-09-23 12:51)