Charles Steinman wrote: > > Michael Schuerig wrote: >> For unit tests I've written a mock object that should check its >> arguments against expected arguments using assertions from >> Test::Unit::Assertions. For instance methods I can include >> Test::Unit::Assertions in the mock class, that's easy. But how can I >> use these assertions in a class method? > > Include them in the mock class's singleton class. > > --- (untested code, but should work) --- > class MockClass > include Test::Unit::Assertions > > class << self # To get the singleton class > include Test::Unit::Assertions > end > > # Whatever methods need to use the assertions > end > --- Thanks, yes, that works, too. I'll need to work with the Ruby object model some more to become really comfortable with it. Michael -- Michael Schuerig Airtight arguments have mailto:michael / schuerig.de vacuous conclusions. http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions