Testing Ruby

This is part of a series of articles I started with Quality Assurance and Automated Testing in Open Source Software.

Ruby is a relatively young dynamic language that got a serious boost in the recent years thanks to the Rails framework for building web application.

Development

Development and patching is described on the Ruby Core page.

Version control: Subversion

Building Ruby from the trunk requires an already working version of Ruby.

The commands to build Ruby are easy:

svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby
cd ruby
autoconf
./configure
make
make test

PASS 729 tests

Actually one can run either make test that will run a smaller set of tests (currently 729 unit tests) or make check that will run a larger set of test but what has crashed last time when I tried with Segmentation fault.

Testing

In the test suit of Ruby they employ the Test::Unit Ruby class. This class provides a set of assertions for the unit tests such as assert(trueness), assert_equal(expected_value, received_value), etc...

Tests can be found in the test/ subdirectory of the source code.

Automated Testing

I asked on the Ruby-Core development mailing list and according to the response there is not automated smoke testing in Ruby.

On the other hand the Rubinius project aimed at creating a virtual machine for Ruby has its own separate set of test creating the specifications.