I forgot to say thanks. :) I do not use test/unit any more, but this:
require 'test/unit/assertions' include Test::Unit::Assertions and now I can use assert where ever I like. :) Zeljko -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Morris Sent: Monday, October 17, 2005 4:30 PM To: [email protected] Subject: Re: [Wtr-general] OO and test/unit Zeljko Filipin wrote: >When I comment assertions (lines 16 and 20) it works. But I really like >assertions. I made class User child of Test::Unit::TestCase (class User < >Test::Unit::TestCase) but it does not work. > That /should/ work, perhaps you could report your error message on that. Another (perhaps better option) is to use a Module and mixins. Instead of making User a class, make it a Module, then include that module in whatever TestCase class you make. I don't have time to detail this for you, but look at rubycentral.com for the older 1.6 Ruby book and find its write-up on Modules and mixins, or hit up the main Ruby list for more assistance with this. -- Chris http://clabs.org/blogki _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
