Last Updated: February 25, 2016
·
915
· x3ro

Testing your spec against multiple rubies

When you write a spec or some tests for an open source audience, you might want to test it against multiple Ruby versions.

Good thing that there is RVM which lets you switch rubies quickly, right? Well, RVM is even more awesome than you thought, because you can simply do this:

rvm 1.8.7,1.9.3 do bundle exec rake spec

Which will automatically run bundle exec rake spec for the specified rubies, without you ever having to change the active one manually.

Merry testing.

1 Response
Add your response

There is a tool that automates the process a bit more: https://github.com/lsegal/rvm-tester and it has support for .travis.yml.

over 1 year ago ·