in reply to Re^2: Share code among tests
in thread Share code among tests
orBEGIN { chdir '..' unless -d 't'; } use t::Whatever;
orBEGIN { chdir 't' if -d 't'; } use Whatever;
Now that only allows you to run the tests either from the 't' directory, or the top-level distro directory (using either "make test", "prove", or a path to the test file), but I've never felt the urge to run the tests from any other directory.BEGIN { chdir '..' unless -d 't'; } push @INC, 't'; use Whatever;
|
|---|