[Rt-commit] r6095 - in RT-Extension-TicketAging: .
schwern at bestpractical.com
schwern at bestpractical.com
Thu Sep 28 19:14:13 EDT 2006
Author: schwern
Date: Thu Sep 28 19:14:12 2006
New Revision: 6095
Modified:
RT-Extension-TicketAging/ (props changed)
RT-Extension-TicketAging/t/02.finished-age.t
RT-Extension-TicketAging/t/utils.pl
Log:
r19434 at Master-Windhund-IV: schwern | 2006-09-28 16:14:02 -0700
Stick the repeated code to run and test rt-aging into run_exec_ok()
Modified: RT-Extension-TicketAging/t/02.finished-age.t
==============================================================================
--- RT-Extension-TicketAging/t/02.finished-age.t (original)
+++ RT-Extension-TicketAging/t/02.finished-age.t Thu Sep 28 19:14:12 2006
@@ -14,9 +14,7 @@
my ($id) = $ticket->Create( Queue => 'General', Status => 'resolved' );
ok($id, "created ticket");
- my ($res, $err) = run_exec( debug => 1 );
- my $ferr = filter_log( $err );
- ok(!$ferr, 'no error') or diag $err;
+ run_exec_ok;
$ticket = RT::Ticket->new( $RT::SystemUser );
$ticket->Load( $id );
@@ -34,9 +32,7 @@
my ($cid) = $ticket->Create( Queue => 'General', Status => 'resolved', MemberOf => $pid );
ok($cid, "created child ticket");
- my ($res, $err) = run_exec( debug => 1 );
- my $ferr = filter_log( $err );
- ok(!$ferr, 'no error') or diag($err);
+ run_exec_ok;
$ticket->Load( $pid );
is($ticket->id, $pid, 'loaded ticket');
@@ -57,9 +53,7 @@
my ($cid) = $ticket->Create( Queue => 'General', MemberOf => $pid );
ok($cid, "created child ticket");
- my ($res, $err) = run_exec( debug => 1 );
- my $ferr = filter_log( $err );
- ok(!$ferr, 'no error') or diag($err);
+ run_exec_ok;
$ticket->Load( $pid );
is($ticket->id, $pid, 'loaded ticket');
@@ -80,9 +74,7 @@
my ($cid) = $ticket->Create( Queue => 'General', Status => 'resolved', MemberOf => $pid );
ok($cid, "created child ticket");
- my ($res, $err) = run_exec( debug => 1 );
- my $ferr = filter_log( $err );
- ok(!$ferr, 'no error') or diag $err;
+ run_exec_ok;
$ticket->Load( $pid );
is($ticket->id, $pid, 'loaded ticket');
Modified: RT-Extension-TicketAging/t/utils.pl
==============================================================================
--- RT-Extension-TicketAging/t/utils.pl (original)
+++ RT-Extension-TicketAging/t/utils.pl Thu Sep 28 19:14:12 2006
@@ -40,6 +40,15 @@
return ($result, $error);
}
+
+sub run_exec_ok {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+ my ($res, $err) = run_exec( debug => 1 );
+ my $ferr = filter_log( $err );
+ ok(!$ferr, 'no error') or diag $err;
+}
+
+
sub filter_log {
my $msg = shift;
$msg =~ s/^\[[^\]]+\]\s*\[(?:debug|info|warning)\]:.*?$//gms;
More information about the Rt-commit
mailing list