Hi!

On Wed, Feb 14, 2007 at 09:46:19AM +1100, Kirrily Robert wrote:
> example used Test::Class's setup/teardown; would anyone else be able 
> to
> provide confirm that I'm making sense in the following
> Test::Harness/Test::More style example:

I had to do something similar just yesterday. I wrote a small testlib.pm
that does some setup with import() and some teardown in an END-block

In the test scripts I say:

  use lib qw(t);
  use testlib qw(things to setup);

in testlib.pm, the custom written import method sets up stuff according 
to the (slightly misused) import-list (eg qw(things to setup)). And the 
END-block just tears down everything (after checking it's there...)

I guess with some more fiddling the END-block could be made smart enough 
to only tear down stuff that was actually set up, but it worked for 
me...


-- 
#!/usr/bin/perl                               http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Reply via email to