Read more

makandra/gemika: Helpers for testing Ruby gems

Henning Koch
September 23, 2016Software engineer at makandra GmbH

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.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

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 14:51)