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

jesse at bestpractical.com jesse at bestpractical.com
Fri Jul 4 06:37:31 EDT 2008


Author: jesse
Date: Fri Jul  4 06:37:26 2008
New Revision: 13797

Modified:
   sd/trunk/Makefile.PL
   sd/trunk/bin/sd
   sd/trunk/t/attachment-content.t

Log:
 * more work to start passing tests

Modified: sd/trunk/Makefile.PL
==============================================================================
--- sd/trunk/Makefile.PL	(original)
+++ sd/trunk/Makefile.PL	Fri Jul  4 06:37:26 2008
@@ -7,6 +7,7 @@
 
 requires 'Prophet'; # URI UNIVERSAL::require Params::Validate Path::Class Class::Accessor
 requires('Clone');
+requires('Moose'); # Moose::Role
 requires('DateTime');
 features(
     'RT sync' => [

Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd	(original)
+++ sd/trunk/bin/sd	Fri Jul  4 06:37:26 2008
@@ -68,30 +68,30 @@
 
 
 
-package App::SD::CLI::Model::Attachment::Create;
+package App::SD::CLI::Command::Attachment::Create;
 use Moose;
 extends 'Prophet::CLI::Command::Create';
 with 'App::SD::CLI::Model::Attachment';
 
-sub run {
+override run => sub {
     my $self = shift;
-
+    warn "here";
     $self->args->{'content'} = $self->get_content('attachment');
+    super(@_);
 
-    $self->SUPER::run(@_);
-
-}
+};
 
 package App::SD::CLI::Command::Ticket::Attachment::Create;
 use Moose;
-extends qw/App::SD::CLI::Model::Attachment::Create/;
+extends 'App::SD::CLI::Command::Attachment::Create';
 # override args to feed in that ticket's uuid as an argument to the comment
 
-sub run {
+override run => sub  {
     my $self = shift;
-    $self->args->{'ticket'} = $self->uuid;
-    $self->SUPER::run(@_);
-}
+    warn YAML::Dump($self); use YAML;
+    #$self->args->{'ticket'} = $self->uuid;
+    super(@_);
+};
 
 
 package App::SD::CLI::Command::Ticket::Attachment::Search;
@@ -112,7 +112,7 @@
 }
 
 
-package App::SD::CLI::Model::Attachment::Content;
+package App::SD::CLI::Command::Attachment::Content;
 use Moose;
 extends 'Prophet::CLI::Command::Show';
 with 'App::SD::CLI::Model::Attachment';

Modified: sd/trunk/t/attachment-content.t
==============================================================================
--- sd/trunk/t/attachment-content.t	(original)
+++ sd/trunk/t/attachment-content.t	Fri Jul  4 06:37:26 2008
@@ -35,17 +35,16 @@
 my $attachment_id;
 run_output_matches(
     'sd',
-    [ qw/ticket attachment create --uuid/, $yatta_uuid, '--file', $file ],
+    [ qw/ticket attachment create --ticket/, $yatta_uuid, '--file', $file ],
     [   qr/Created attachment (\d+)(?{$attachment_id = $1}) \((.*?)(?{ $attachment_uuid = $2})\)$/
     ],
     [],
     "Added a attachment"
 );
 ok($attachment_uuid);
-
 run_output_matches(
     'sd',
-    [ qw/ticket attachment list --uuid/, $yatta_uuid ],
+    [ qw/ticket attachment list --ticket/, $yatta_uuid ],
     [ $attachment_uuid . " paper_order.doc text/plain" ],
     ,
     [],
@@ -65,7 +64,7 @@
 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 (\d+)(?{ $image_attach = $1})/], [], "Added a attachment");
+run_output_matches('sd', [qw/ticket attachment create --ticket/, $yatta_uuid, '--file', $image_file], [qr/Created attachment (\d+)(?{ $image_attach = $1})/], [], "Added a attachment");
 
 my $image_data = file($image_file)->slurp;
 my ($ret, $stdout, $stderr) = run_script('sd', [qw/attachment content --id/, $image_attach]);



More information about the Bps-public-commit mailing list