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

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Fri May 14 14:27:38 EDT 2004


Author: autrijus
Date: Fri May 14 14:27:37 2004
New Revision: 899

Modified:
   RT-Client/   (props changed)
   RT-Client/lib/RT/Client.pm
   RT-Client/t/1-procedural.t
Log:
 ----------------------------------------------------------------------
 r4890 at not:  autrijus | 2004-05-14T18:27:06.062997Z
 
 * implement debugging.
 ----------------------------------------------------------------------
 r4891 at not:  autrijus | 2004-05-14T18:27:37.185850Z
 
 * remove extra newlines.
 ----------------------------------------------------------------------


Modified: RT-Client/lib/RT/Client.pm
==============================================================================
--- RT-Client/lib/RT/Client.pm	(original)
+++ RT-Client/lib/RT/Client.pm	Fri May 14 14:27:37 2004
@@ -22,6 +22,7 @@
 field path      => '/Atom/0.3/';
 field server    => 'localhost';
 field encoding  => 'UTF-8';
+field debug     => 0;
 field 'ua';
 field 'current_user';
 field 'status';
@@ -104,7 +105,8 @@
 
 sub set {
     splice(@_, 1, 0, 'content') if (@_ == 2 and $_[0] ne 'URI');
-    my $res = $self->_request(@_, method => 'PUT') or return undef;
+    my $res = $self->_request(@_, method => 'GET'); # XXX - ditch this asap
+    $res = $self->_request(@_, method => 'PUT') or return undef;
     return $self->_spawn($res);
 }
 
@@ -164,9 +166,13 @@
         $req->content(delete $args{content}) if exists $args{content};
     }
 
+    print STDERR "===> " . $req->as_string if $self->debug;
+
     my $res = $self->make_request($req);
     $self->status($res->code);
 
+    print STDERR "<=== " . $res->as_string if $self->debug;
+
     if ($res->is_error) {
         $self->errstr($res->content);
         return;

Modified: RT-Client/t/1-procedural.t
==============================================================================
--- RT-Client/t/1-procedural.t	(original)
+++ RT-Client/t/1-procedural.t	Fri May 14 14:27:37 2004
@@ -16,6 +16,8 @@
 # Requirements:
 # 1. Ticket Creation and Modification via an External Interface
 
+$rt->debug(0);
+
 my $tickets = $rt->describe('Tickets');
 isa_ok($tickets, 'RT::Client::Container', '->describe($uri)');
 isnt($tickets->uri, undef, 'Tickets has a URI: '.$tickets->uri);


More information about the Rt-commit mailing list