From: Brian Candler Date: 2009-03-30T17:27:28+09:00 Subject: Re: testy.rb - ruby testing that's mad at the world Ara Howard wrote: > i always end up writing both samples and tests Just a thought: I've found myself doing that too, but in particular I've ran an example externally to be sure it works, then ended up pasting it into the rdoc. So it would be really cool if rdoc could integrate the examples directly in the appropriate place(s). I want to be sure that my examples actually run as advertised, and at the moment I risk them becoming out of date, so I'm definitely with you on that point. However, one problem with having runnable examples/specs is that you often have a lot of setup (and/or mock) code to make something run. This risks adding too much noise to the examples, so structuring the code so as to be able to filter that out would be a bonus - i.e. show me just the example, not the setup or post-conditions. Not easy to do without ripping the Ruby though. I find the other kill-yourself part of testing is behavioural testing with mock objects, but that's out of scope here I think :-) Regards, Brian. -- Posted via http://www.ruby-forum.com/.