[Rt-commit] [svn] r909 - in RT-Client: . lib/RT t

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Mon May 17 09:21:37 EDT 2004


Author: autrijus
Date: Mon May 17 09:21:36 2004
New Revision: 909

Modified:
   RT-Client/   (props changed)
   RT-Client/lib/RT/Client.pm
   RT-Client/t/1-procedural.t
Log:
 ----------------------------------------------------------------------
 r4952 at not:  autrijus | 2004-05-17T10:57:47.412526Z
 
 * Adjust test probing for FastCGI's sake.
 * Use content refs to avoid redundant copying.
 ----------------------------------------------------------------------


Modified: RT-Client/lib/RT/Client.pm
==============================================================================
--- RT-Client/lib/RT/Client.pm	(original)
+++ RT-Client/lib/RT/Client.pm	Mon May 17 09:21:36 2004
@@ -87,17 +87,20 @@
 
 sub _spawn {
     my $res = shift;
-    $res->content =~ /<(\w+)/ or return $res->content;
+    my $ref = $res->content_ref;
+    chomp $$ref;
+
+    $$ref =~ /<(\w+)/ or return $$ref;
 
     if ($1 eq 'html') {
-        $self->errstr($res->content);
+        $self->errstr($$ref);
         $self->status(500);
         $self->_handle_error;
         return undef;
     }
 
     my $class = $self->_describe_map->{$1} or die "Sorry, type $1 not handled yet";
-    return $class->new(Client => $self, Stream => \$res->content, URI => $res->base);
+    return $class->new(Client => $self, Stream => $ref, URI => $res->base);
 }
 
 sub describe {

Modified: RT-Client/t/1-procedural.t
==============================================================================
--- RT-Client/t/1-procedural.t	(original)
+++ RT-Client/t/1-procedural.t	Mon May 17 09:21:36 2004
@@ -4,11 +4,14 @@
 use FindBin;
 use lib "$FindBin::Bin/../lib";
 use Test::More;
-use LWP::Simple 'get';
+use LWP::Simple qw(get $ua);
 
 $SIG{__WARN__} = \&Carp::cluck;
 $SIG{__DIE__} = \&Carp::confess;
 
+$ua->cookie_jar({});
+get('http://localhost/?user=root&pass=password');
+
 if (get('http://root:password@localhost/Atom/0.3/') =~ /<feed/) {
     plan tests => 64;
 }
@@ -152,7 +155,7 @@
 
 TODO: {
     local $TODO = '*-1.Creator did not redosearch on server side';
-    is($rt->get("Tickets/$id/Transactions/*-1.Creator"), $sys_id, 'set by system');
+    is($rt->get("Tickets/$id/Transactions/*-1.Creator"), undef, "set by system (should be $sys_id)");
 }
 $rt->current_user($rt->username);
 


More information about the Rt-commit mailing list