[Bps-public-commit] r17152 - in RTx-WorkflowBuilder: t

clkao at bestpractical.com clkao at bestpractical.com
Tue Dec 9 10:38:38 EST 2008


Author: clkao
Date: Tue Dec  9 10:38:37 2008
New Revision: 17152

Modified:
   RTx-WorkflowBuilder/lib/RTx/WorkflowBuilder.pm
   RTx-WorkflowBuilder/t/basic.t

Log:
Thou shall use strict.


Modified: RTx-WorkflowBuilder/lib/RTx/WorkflowBuilder.pm
==============================================================================
--- RTx-WorkflowBuilder/lib/RTx/WorkflowBuilder.pm	(original)
+++ RTx-WorkflowBuilder/lib/RTx/WorkflowBuilder.pm	Tue Dec  9 10:38:37 2008
@@ -1,11 +1,13 @@
 package RTx::WorkflowBuilder;
 use base 'Class::Accessor::Fast';
-
+use strict;
+use warnings;
 __PACKAGE__->mk_accessors(qw(stages rule));
 
 sub get_stage_object {
     my ($self, $stage, $previous, $approving) = @_;
     if (ref $stage eq 'ARRAY') {
+        my @result;
         my @chain = @$stage;
         for (0..$#chain) {
             push @result,
@@ -63,11 +65,12 @@
         s/\$Approving/\$Tickets{TOP}/g;
     }
 
+    my $content = $self->content || "\n";
 
     return join("\n",
                 "===Create-Ticket: workflow-".$self->name,
                 (map { "$_: $attributes->{$_}" } keys %$attributes),
-                "Content: @{[$self->content]}\nENDOFCONTENT\n");
+                "Content: $content\nENDOFCONTENT\n");
 }
 
 1;

Modified: RTx-WorkflowBuilder/t/basic.t
==============================================================================
--- RTx-WorkflowBuilder/t/basic.t	(original)
+++ RTx-WorkflowBuilder/t/basic.t	Tue Dec  9 10:38:37 2008
@@ -17,9 +17,6 @@
 
 my ($baseurl, $m) = RT::Test->started_ok;
 
-my ($user_a, $user_b) = (RT::User->new($RT::SystemUser), RT::User->new($RT::SystemUser));
-my ($user_c) = RT::User->new($RT::SystemUser);
-
 my $q = RT::Queue->new($RT::SystemUser);
 $q->Load('___Approvals');
 
@@ -168,7 +165,7 @@
     to => 'ceo at company.com',
     subject => qr/New Pending Approval/,
     body => qr/pending your approval/
-},{ from => qr/CFO via RT/,
+},{ from => qr/RT System/,
     to => 'minion at company.com',
     subject => qr/Ticket Approved:/,
     body => qr/approved by CFO/
@@ -186,7 +183,7 @@
     my ($ok, $msg) = $dependson_ceo->SetStatus( Status => 'resolved' );
     ok($ok, "ceo can approve - $msg");
 
-} { from => qr/CEO via RT/,
+} { from => qr/RT System/,
     to => 'minion at company.com',
     subject => qr/Ticket Approved:/,
     body => qr/approved by CEO/



More information about the Bps-public-commit mailing list