|
|
| more useful options | |
| PerlMonks |
Re: Order of startup methods with Test::Classby Ovid (Cardinal) |
| on Oct 09, 2011 at 15:02 UTC ( #930476=note: print w/ replies, xml ) | Need Help?? |
|
This is a common anti-pattern I see in Test::Class code. If you have a subclass, you should view this as a more specific instance of your parent class. Your startup/setup/teardown/shutdown methods (which I refer to as "test control methods") shouldn't rely on a prefix hack, as you rightly pointed out. Instead, you override them and your subclass calls the parent class's method as appropriate:
With this approach, you have complete control over the order of how things run and you don't have to worry about prefixes. You might want to read my tutorial on Test::Class, in particular the test control methods section.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||