[Rt-commit] r8654 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test

ruz at bestpractical.com ruz at bestpractical.com
Mon Aug 20 19:43:57 EDT 2007


Author: ruz
Date: Mon Aug 20 19:43:56 2007
New Revision: 8654

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test/Web.pm

Log:
* 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-TUNIS/lib/RT/Test/Web.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test/Web.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test/Web.pm	Mon Aug 20 19:43:56 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