[Rt-commit] r8767 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Tue Aug 28 14:38:24 EDT 2007


Author: ruz
Date: Tue Aug 28 14:38:23 2007
New Revision: 8767

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Test/Web.pm

Log:
 r8655 at cubic-pc (orig r8654):  ruz | 2007-08-21 03:43:56 +0400
 * override get_ok so we don't have to fetch base url all the time,
   just call it using leading '/' and URL would be anchored to RT's
   base URL. Isn't it awesome?


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Test/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Test/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Test/Web.pm	Tue Aug 28 14:38:23 2007
@@ -8,6 +8,15 @@
 require RT::Test;
 require Test::More;
 
+sub get_ok {
+    my $self = shift;
+    my $url = shift;
+    if ( $url =~ m{^/} ) {
+        $url = $self->rt_base_url . $url;
+    }
+    return $self->SUPER::get_ok($url, @_);
+}
+
 sub rt_base_url {
     return $RT::Test::existing_server if $RT::Test::existing_server;
     return "http://localhost:" . RT->Config->Get('WebPort') . RT->Config->Get('WebPath') . "/";


More information about the Rt-commit mailing list