Website / Report Issue / Source Code ( Build Status )

Fluidity is an assertions framework that provides a very elegant fluid notation for specifying test assertions.

Fluidity is built on top of the Assay assertions meta-framework, giving it a solid foundation. Assay defines assertions in the same way that Ruby defines exceptions. Assay provides a complete set of these assertion classes for all common assertion needs.


Developers want to write assertions easily and concisely. To this end Fluidity provides a flexible grammar system which can be used by requiring any of the prime grammar methods that extend Object. The most common is probably should.

require 'fluidity/should'


But if you are accustom to MiniTest's spec methods, you might prefer must.

require 'fluidity/must'


Also provided is assert for those techy aficionados.

require 'fluidity/assert'


So what is so fluid about all this? Well, Fluidity allows the developer quite the English like expression. For instance.


Pretty neat, though perhaps bit excessive for a real-life use. Generally it's good enough to use the shorter and a tad bit faster:


Speaking of fast, so what about speed? Of course, running through multiple extra method calls to make an assertion is going to be slower than making just a single method call. So, yes, tests might run a bit slower on Fluidity than they would with another less readable assertions system. However, method calls are pretty dang fast and unlikely to present any significant performance overhead on test runs. At most, tests runs might take a few additional seconds for very large test suites.


To install with RubyGems simply open a console and type:

gem install fluidity

Site installation with the tarball can be done with Ruby Setup (gem install setup). See http://rubyworks.github.com/setup.


Fluidity is copyrighted open source software.

Copyright (c) 2012 Rubyworks

This program can be modified and distributed in accordance with the terms of the BSD-2-Clause license.

See LICENSE.txt file for details.