Building a unit test framework ==> from lisp to ruby


(Piergiuliano Bossi) #1

On the way to learn ruby effectively, I have tried to develop the same
framework as the one described by Peter Seibel in [1]. This was also the
cause of my questions in [2].

In terms of pure framework, my ruby version is more compact (only 11
lines of code) and it looks more understandable to me (I’m not really a
lisper, anyway), although I miss the code=data feature of lisp somehow.

I know that every test expression is evaluated twice, but I don’t mind
very much about it, unless the double computation can be removed without
adding new lines of code.

This simple exercise has made me appreciate ruby for its conjunction of
power and simplicity.

I’d like to have your feedback on the attached version.
Thanks, Giuliano

[1] - http://tinyurl.com/2b99d
[2] - rubytalk:92492 ==>
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/92492

Test7.rb (654 Bytes)

···


If you want to send me an email in the address you have to write ‘p’,
then a dot, followed by ‘bossi’ at ‘quinary’, another dot and ‘com’ at last