* Posting on behalf of James Mead (email@example.com) *
Sounds interesting. I've been doing my own monkey-patching recently
have noticed a couple of other people
doing similar things. It would be really good to get support for
multiple setup/teardown methods into the Test::Unit library.
P.S. Apologies if this message is duplicated, I noticed that I sent to
the old list address and am therefore re-sending.
I’d like class methods to declare setup/teardown behavior:
setup :load_fixtures, :begin_transaction
same with teardown
def self.setup(*methods, &block)
setup_methods << block if block_given?
unfortunately difficult to override, have to replace wholesale
#instead of setup
#instead of teardown
My plugin allows you to do that. It’s a huge hack, but it works for me! As far as I know it is completely backwards compatible.
We use the same approach (method_added). I hope test/unit breaks its run method into more digestible chunks to make this unnecessary.