| [ next ] [ prev ] [ contents ] | XP-Cinti TDD Workshop |
Test::Unit is an xUnit testing framework for Ruby. It is similar to JUnit, but the author (Nathaniel Talbot) went back to the original Smalltalk version when doing the implementation.
Verion 0.1.6 is the latest version and will be packaged with the Ruby language in the next version release of Ruby (which will be Real Soon Now).
Most of the examples in this talk were done with Test::Unit version 0.1.4, which is what I had on my laptop the night of the XP meeting. At some point during the writing of this article, I upgraded to version 0.1.6 and if you look closely you can see the style of output change slightly. Have fun looking for it.
One incompatibility between 0.1.4 and 0.1.6 is that the set up method is spelled "set_up" in 0.1.4 and "setup" in 0.1.6. I went back and retroactively changed all the examples to work with the 0.1.6 version. So you will see setup through out this article.
One other minor difference is that 0.1.6 considers a test case class with no tests to be a failure. So running the test example on this page will give the following output under 0.1.6 ...
$ ruby x.rb Loaded suite x Started . Failure!!! run: No tests were run. Finished in 0.007512 seconds. 0 tests, 0 assertions, 1 failures, 0 errors |
It is currently being debated if this behavior should remain, or if
the original behavior should be restored.
| [ next ] [ prev ] [ contents ] | Copyright 2003 by Jim Weirich.![]() |