[Rt-commit] rt branch, 3.999-trunk, updated. 59629ea100899b422b91b7484157163e47b0405f

sartak at bestpractical.com sartak at bestpractical.com
Mon Nov 16 19:30:53 EST 2009


The branch, 3.999-trunk has been updated
       via  59629ea100899b422b91b7484157163e47b0405f (commit)
      from  f469be7ce02a09f8ebdfbb37801d6f580b14bf6f (commit)

Summary of changes:
 Makefile.PL                       |    1 +
 t/ticket/action_linear_escalate.t |   12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 59629ea100899b422b91b7484157163e47b0405f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Nov 16 19:30:41 2009 -0500

    Use Test::Script::Run for linear_escalate

diff --git a/Makefile.PL b/Makefile.PL
index 515df14..fdb5c2a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -50,6 +50,7 @@ requires(
 test_requires (
     'Test::Expect'        => 0,
     'Test::MockTime'      => 0,
+    'Test::Script::Run'   => '0.03',
     'String::ShellQuote'  => 0,
 );
 
diff --git a/t/ticket/action_linear_escalate.t b/t/ticket/action_linear_escalate.t
index ce5f5ef..d8eca1b 100644
--- a/t/ticket/action_linear_escalate.t
+++ b/t/ticket/action_linear_escalate.t
@@ -4,7 +4,8 @@ use strict;
 use warnings;
 use RT::Test strict => 1;
 
-use Test::More tests => 17;
+use Test::More tests => 20;
+use Test::Script::Run 'run_ok';
 use RT;
 
 my ($id, $msg);
@@ -93,8 +94,13 @@ sub escalate_ticket_ok {
     my $id = $ticket->id;
 
     my $crontool = RT->bin_path . '/rt-crontool';
-    print "$crontool --search RT::Search::FromSQL --search-arg \"id = @{[$id]}\" --action RT::ScripAction::LinearEscalate --action-arg \"RecordTransaction:$RecordTransaction; UpdateLastUpdated:$UpdateLastUpdated\"\n";
-    print STDERR `$crontool --search RT::Search::FromSQL --search-arg "id = @{[$id]}" --action RT::ScripAction::LinearEscalate --action-arg "RecordTransaction:$RecordTransaction; UpdateLastUpdated:$UpdateLastUpdated"`;
+
+    run_ok($crontool, [
+        '--search'     => 'RT::Search::FromSQL',
+        '--search-arg' => "id = $id",
+        '--action'     => 'RT::ScripAction::LinearEscalate',
+        '--action-arg' => "RecordTransaction:$RecordTransaction; UpdateLastUpdated:$UpdateLastUpdated",
+    ], 'ran crontool successfully');
 
     Jifty::DBI::Record::Cachable->flush_cache;
     $ticket->load($id);     # reload, because otherwise we get the cached value

-----------------------------------------------------------------------


More information about the Rt-commit mailing list