[Bps-public-commit] r12163 - in sd/trunk: . bin

jesse at bestpractical.com jesse at bestpractical.com
Thu May 8 17:47:00 EDT 2008


Author: jesse
Date: Thu May  8 17:46:59 2008
New Revision: 12163

Modified:
   sd/trunk/   (props changed)
   sd/trunk/bin/sd
   sd/trunk/t/attachment-content.t

Log:
 r30560 at 106 (orig r12120):  jesse | 2008-05-06 19:24:06 -0400
 * binary attachments. 


Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd	(original)
+++ sd/trunk/bin/sd	Thu May  8 17:46:59 2008
@@ -66,7 +66,7 @@
     my $self = shift;
     my $record =  $self->_get_record;
     $record->load(uuid => $self->cli->uuid);
-    print $record->prop('content') ."\n";
+    print $record->prop('content');
 }
 
 package App::SD::CLI::Command::Help;

Modified: sd/trunk/t/attachment-content.t
==============================================================================
--- sd/trunk/t/attachment-content.t	(original)
+++ sd/trunk/t/attachment-content.t	Thu May  8 17:46:59 2008
@@ -2,7 +2,7 @@
 
 use strict;
 
-use Prophet::Test tests => 6;
+use Prophet::Test tests => 10;
 
 use File::Temp qw/tempdir/;
 use Path::Class;
@@ -42,6 +42,20 @@
     'name: paper_order.doc', 
     'content_type: text/plain' ], [], "Found the attachment, but doesn't show the content");
 
-
 run_output_matches('sd', [qw/attachment content --uuid/, $attachment_uuid], ['5 tonnes of hard white'],[], "We got the content");
 
+
+diag("Add a binary attachment");
+
+my $image_attach;
+my $image_file = 't/data/bplogo.gif';
+
+run_output_matches('sd', [qw/ticket attachment create --uuid/, $yatta_uuid, '--file', $image_file], [qr/Created attachment (.*?)(?{ $image_attach = $1})$/], [], "Added a attachment");
+
+my $image_data = file($image_file)->slurp;
+
+my ($ret, $stdout, $stderr) = run_script('sd', [qw/attachment content --uuid/, $image_attach]);
+ok($ret, "Ran the script ok");
+is($stdout, $image_data, "We roundtripped some binary");
+is($stderr, '');
+



More information about the Bps-public-commit mailing list