Lapidary - A Ruby Unit Testing Framework

Ruby - n. *1
"A precious stone; a mineral of a carmine red color... The ruby is next in hardness and value to the diamond, and highly esteemed in jewelry."
Lapidary - a.
"Pertaining to the art of cutting stones."
Lapidary - n.
  1. "An artificer who cuts precious stones."
  2. "A dealer in precious stones."
  3. "A virtuoso skilled in the nature and kinds of gems or precious stones."

First of all, let me just say, Ruby rules! It is definitely a "gem of a language." It's name indicates this: only a diamond is more valuable than a ruby, and I just don't fancy programming in 'diamond;' how corny ;-)

Unit testing is making waves all over the place, largely due to the fact that it is a core practice of XP. While XP is great, unit testing has been around for a long time and has always been a good idea. One of the keys to good unit testing, though, is not just writing tests, but having tests. What's the difference? Well, if you just write a test and throw it away, you have no guarantee that something won't change later which breaks your code. If, on the other hand, you have tests (obviously you have to write them first), and run them as often as possible, you slowly build up a wall of things that cannot break without you immediately knowing about it. This is when unit testing hits its peak usefulness.

Enter Lapidary. In the 'real' world, a lapidary is someone who cuts, polishes and appraises precious stones. Likewise, Lapidary is a framework for unit testing in Ruby, helping you to design, debug and evaluate your code by making it easy to write and have tests for it.

Installation

Simply decompress the Lapidary archive into a directory on your Ruby library path (probably ruby/site_ruby/x.x where x.x is the Ruby version your using).

Documentation

Version Information

You can check out the ChangeLog for what's new in the current version and the version history.

Feedback

I like (and practice) XP, so I value early releases, user feedback, and clean, simple, expressive code. There is always room for improvement in everything I do, and Lapidary is no exception. Please, let me know what you think of Lapidary as it stands, and what you'd like to see expanded/changed/improved/etc. If you find a bug, let me know ASAP; one good way to let me know what the bug is is to submit a new test that catches it :-) Also, I'd love to hear about any successes you have with Lapidary, and any documentation you might add will be greatly appreciated.

Contact Info

A lot of discussion happens about Ruby in general on the ruby-talk mailing list, and you can ask any questions you might have there. I monitor the list, as do many other helpful Rubyists, and you're sure to get a quick answer. Of course, you're also welcome to email me (Nathaniel Talbott) directly at lapidary@talbott.ws, and I'll do my best to help you out.

Notes

License

Lapidary is free software licensed under the GNU General Public License. For more information, see the LICENSE file.


*1All definitions taken from Noah Webster's 1828 American Dictionary of the English Language.