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

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Tue Aug 3 22:13:32 EDT 2004


Author: autrijus
Date: Tue Aug  3 22:13:31 2004
New Revision: 1303

Modified:
   RT-Client/   (props changed)
   RT-Client/Changes
   RT-Client/META.yml
   RT-Client/lib/RT/Client.pm
   RT-Client/t/1-procedural.t
Log:
 r5209 at not:  autrijus | 2004-05-25T17:12:28.066904Z
 
 r6785 at not:  autrijus | 2004-08-04T02:08:33.544270Z
 * update handling for mimeobj.


Modified: RT-Client/Changes
==============================================================================
--- RT-Client/Changes	(original)
+++ RT-Client/Changes	Tue Aug  3 22:13:31 2004
@@ -1,3 +1,7 @@
+[Changes for 0.00_04 - August 4, 2004]
+
+Add first draft of MIMEObj handling for ->update.
+
 [Changes for 0.00_03 - May 19, 2004]
 
 Add missing dependency to URI.

Modified: RT-Client/META.yml
==============================================================================
--- RT-Client/META.yml	(original)
+++ RT-Client/META.yml	Tue Aug  3 22:13:31 2004
@@ -1,5 +1,5 @@
 name: RT-Client
-version: 0.00_03
+version: 0.00_04
 abstract: A client of RT from Best Practical Solutions
 author: Autrijus Tang <autrijus at autrijus.org>
 license: perl
@@ -14,4 +14,4 @@
 no_index:
   directory:
     - inc
-generated_by: Module::Install version 0.33
+generated_by: Module::Install version 0.35

Modified: RT-Client/lib/RT/Client.pm
==============================================================================
--- RT-Client/lib/RT/Client.pm	(original)
+++ RT-Client/lib/RT/Client.pm	Tue Aug  3 22:13:31 2004
@@ -1,7 +1,7 @@
 package RT::Client;
 
 use 5.006;
-our $VERSION = '0.00_03';
+our $VERSION = '0.00_04';
 our @ISA = 'XML::Atom::Client';
 
 =head1 NAME
@@ -10,7 +10,8 @@
 
 =head1 VERSION
 
-This document describes version 0.00_03 of RT::Client, released May 19, 2004.
+This document describes version 0.00_04 of RT::Client,
+released August 4, 2004.
 
 =head1 SYNOPSIS
 
@@ -227,6 +228,11 @@
 
     if ($method eq 'POST') {
         foreach my $key (sort keys %args) {
+            if (ref $args{$key} and UNIVERSAL::can($args{$key}, 'as_string')) {
+                $args{$key} = $args{$key}->as_string;
+            }
+        }
+        foreach my $key (sort keys %args) {
             next unless UNIVERSAL::isa($args{$key}, 'HASH');
             my $val = delete $args{$key};
             while (my ($k, $v) = each %$val) {

Modified: RT-Client/t/1-procedural.t
==============================================================================
--- RT-Client/t/1-procedural.t	(original)
+++ RT-Client/t/1-procedural.t	Tue Aug  3 22:13:31 2004
@@ -13,7 +13,7 @@
 get('http://localhost/?user=root&pass=password');
 
 if (get('http://root:password@localhost/Atom/0.3/') =~ /<feed/) {
-    plan tests => 66;
+    plan tests => 69;
 }
 else {
     plan skip_all => 'Atom 0.3 not available on localhost';
@@ -66,6 +66,27 @@
 ok($rt->update($uri, Subject => { set => [ 'Fnord', 'Set4' ] }), '->update with set + multival');
 is($rt->get("$uri.Subject"), 'Set4', '->update really happened');
 
+ok($rt->update($uri, type => 'Comment', Content => 'somme comment here'),
+  '->update (Comment)');
+ok($rt->update($uri, type => 'Correspond', Content => 'somme comment here'),
+  '->update (Correspond)');
+
+SKIP: {
+    skip 'Cannot load MIME::Entity', 1
+      unless eval { require MIME::Entity; 1 };
+
+    my $mime = MIME::Entity->build(
+        Type     => 'multipart/mixed',
+        From     => 'root',
+        To       => 'root',
+        Subject  => 'Test MIME',
+        Data     => [ 'Line 1', 'Line 2' ],
+    );
+    $mime->attach(Path => __FILE__);
+    ok($rt->update($uri, type => 'Correspond', MIMEObj => $mime),
+    '->update (Correspond + MIME)');
+}
+
 my $queue = $rt->get("$uri.QueueObj");
 isa_ok($queue, 'RT::Client::Object', '->QueueObj');
 my $queue_uri = $queue->uri;


More information about the Rt-commit mailing list