Assay TestUnit

Homepage / Report Issue / Source Code / Mailing List


Assay TestUnit is a compatibility layer for using TestUnit's assertion notation with the Assay assertions framework.

Assay TestUnit defines a set of TestUnit-compatible assertion methods which depend on Assay's assertion classes. This allows developers to change test frameworks without having to change a slew of previously defined assertions calls.

Assay defines assertions in the same way that Ruby defines exceptions. An assertion is nothing more that an extended Exception subclass. Assay provides a complete set of these assertion classes for all common assertion needs. See Assay project for more information on this library.


Simply require the `assay/testunit` script, and include the `Assay::Assertions` mixin module into your test scope, where your test framework requires it (which may be as simple as the toplevel namespace).

require 'assay/testunit'

include Assay::Assertions

Now assertions can be made just as if you were using TestUnit.

assert_equal(10, 5+5)

assert_kind_of(Integer, 10)


Compatibility is not 100%, though it is very close. Compatibility will improve with future releases. Please feel obligated to submit a patch if you need a missing a feature ;)

Assay TestUnit is also a Ruby 1.9+ only library.


To install with RubyGems simply open a console and type:

$ gem install assay-testunit

Site installation with the tarball can be done with Ruby Setup (gem install setup). See


Copyright © 2012 Rubyworks

This program is distributed under the terms of the BSD-2-Clause license.

See COPYING.rdoc file for details.