[Bps-public-commit] r12152 - in sd/branches/attachment-content: .

jesse at bestpractical.com jesse at bestpractical.com
Thu May 8 09:09:29 EDT 2008


Author: jesse
Date: Thu May  8 09:08:56 2008
New Revision: 12152

Modified:
   sd/branches/attachment-content/   (props changed)
   sd/branches/attachment-content/t/sd-rt.t

Log:
- Merged from local

Modified: sd/branches/attachment-content/t/sd-rt.t
==============================================================================
--- sd/branches/attachment-content/t/sd-rt.t	(original)
+++ sd/branches/attachment-content/t/sd-rt.t	Thu May  8 09:08:56 2008
@@ -8,10 +8,10 @@
 use Test::More;
 unless (eval 'use RT::Test; 1') {
     diag $@;
-    plan skip_all => 'requires 3.7 to run tests.';
+    plan skip_all => 'requires 3.7 or newer to run tests.';
 }
 
-eval 'use Prophet::Test tests => 9';
+eval 'use Prophet::Test tests => 11';
 
 no warnings 'once';
 
@@ -106,7 +106,7 @@
     status => 'open',
 )->store();
 
-warn "===> bad pull";
+diag( "===> bad pull");
 ( $ret, $out, $err ) = run_script( 'sd', [ 'pull', '--from', $sd_rt_url ] );
 run_output_matches(
     'sd',
@@ -114,6 +114,36 @@
     [ sort "$yatta_uuid YATTA open", "$flyman_uuid Fly Man stalled", ]
 );
 
+
+my $tick = RT::Client::REST::Ticket->new(
+    rt => $rt,
+    id => $tix[0])->retrieve;
+
+warn $tick->subject;
+warn $tick->status;
+my ($val,$msg) = $tick->comment( message => 'this is a comment', attachments => [qw|t/data/bplogo.gif|]);
+    
+    my $attachments = RT::Client::REST::Ticket->new( rt => $rt, id => $tix[0])->attachments();
+    my $iterator = $attachments->get_iterator;
+    my @attachments;
+    while (my $att = &$iterator) { 
+        if ( $att->file_name eq 'bplogo.gif'  ) {
+        push @attachments, $att ;
+        warn "goto ne";
+    }
+    }
+is (scalar @attachments, 1, "Found our one attachment");
+
+ 
+( $ret, $out, $err ) = run_script( 'sd', [ 'pull', '--from', $sd_rt_url ] );
+run_output_matches(
+    'sd',
+    [ 'ticket',                      'list', '--regex', '.' ],
+    [ sort "$yatta_uuid YATTA open", "$flyman_uuid Fly Man stalled", ]
+);
+
+
+
 #diag $uuid;
 
 1;



More information about the Bps-public-commit mailing list