[Rt-commit] rt branch, 4.0/test-tempdirs, updated. rt-4.0.0-391-g8685727

Thomas Sibley trs at bestpractical.com
Fri Jul 29 11:41:42 EDT 2011


The branch, 4.0/test-tempdirs has been updated
       via  86857277fe240a4701f305b0fb831dca255a95b5 (commit)
      from  4c1ff6fd63416cec3853d2e82d6f105afe803b9b (commit)

Summary of changes:
 lib/RT/Test.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 86857277fe240a4701f305b0fb831dca255a95b5
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jul 29 11:40:42 2011 -0400

    Switch to using $0 instead of caller to get the test file name
    
    This ensures that subclasses of RT::Test don't break our ability to grab
    test file names (by pushing the caller down another level).  Most
    notably, the GPG tests now create the appropriate test directories too.

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index e36188c..57bac30 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -212,7 +212,7 @@ sub bootstrap_tempdir {
     my $self = shift;
     my ($test_dir, $test_file) = ('t', '');
 
-    if (File::Spec->rel2abs((caller(1))[1]) =~ m{(?:^|[\\/])(x?t)[/\\](.*)}) {
+    if (File::Spec->rel2abs($0) =~ m{(?:^|[\\/])(x?t)[/\\](.*)}) {
         $test_dir  = $1;
         $test_file = $2;
         $test_file =~ s{[/\\]}{-}g;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list