[Rt-commit] r6077 - in RT-Extension-TicketAging: .
schwern at bestpractical.com
schwern at bestpractical.com
Thu Sep 28 00:13:59 EDT 2006
Author: schwern
Date: Thu Sep 28 00:13:58 2006
New Revision: 6077
Modified:
RT-Extension-TicketAging/ (props changed)
RT-Extension-TicketAging/t/01.basics.t
RT-Extension-TicketAging/t/02.finished-age.t
RT-Extension-TicketAging/t/03.dead-age.t
RT-Extension-TicketAging/t/04.extinct-age.t
RT-Extension-TicketAging/t/05.destroyed-age.t
RT-Extension-TicketAging/t/utils.pl
Log:
r19399 at Master-Windhund-IV: schwern | 2006-09-27 21:13:48 -0700
I got sick of writing diag('foo') if $ENV{'TEST_VERBOSE'} so I wrote verbose()
Modified: RT-Extension-TicketAging/t/01.basics.t
==============================================================================
--- RT-Extension-TicketAging/t/01.basics.t (original)
+++ RT-Extension-TicketAging/t/01.basics.t Thu Sep 28 00:13:58 2006
@@ -8,13 +8,13 @@
BEGIN { require 't/utils.pl' }
RT::Init();
-diag("simle test of the script") if $ENV{'TEST_VERBOSE'};
+verbose("simle test of the script");
{
my ($res, $err) = run_exec();
ok(!$err, 'no error') or diag $err;
}
-diag("check custom field") if $ENV{'TEST_VERBOSE'};
+verbose("check custom field");
{
my $cf = RT::CustomField->new( $RT::SystemUser );
$cf->LoadByNameAndQueue( Name => 'Age', Queue => 0 );
@@ -24,7 +24,7 @@
}
}
-diag("active age") if $ENV{'TEST_VERBOSE'};
+verbose("active age");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($id) = $ticket->Create( Queue => 'General' );
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 00:13:58 2006
@@ -8,7 +8,7 @@
BEGIN { require 't/utils.pl' }
RT::Init();
-diag("finished age") if $ENV{'TEST_VERBOSE'};
+verbose("finished age");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($id) = $ticket->Create( Queue => 'General', Status => 'resolved' );
@@ -24,7 +24,7 @@
is($ticket->FirstCustomFieldValue('Age'), 'Finished', 'correct age');
}
-diag("finished age: child is resolved, parent is not") if $ENV{'TEST_VERBOSE'};
+verbose("finished age: child is resolved, parent is not");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($pid) = $ticket->Create( Queue => 'General' );
@@ -47,7 +47,7 @@
is($ticket->FirstCustomFieldValue('Age'), 'Finished', 'correct age');
}
-diag("finished age: parent is resolved while child is not") if $ENV{'TEST_VERBOSE'};
+verbose("finished age: parent is resolved while child is not");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($pid) = $ticket->Create( Queue => 'General', Status => 'resolved' );
@@ -70,7 +70,7 @@
is($ticket->FirstCustomFieldValue('Age'), 'Active', 'correct age');
}
-diag("finished age: parent is resolved as all its children") if $ENV{'TEST_VERBOSE'};
+verbose("finished age: parent is resolved as all its children");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($pid) = $ticket->Create( Queue => 'General', Status => 'resolved' );
Modified: RT-Extension-TicketAging/t/03.dead-age.t
==============================================================================
--- RT-Extension-TicketAging/t/03.dead-age.t (original)
+++ RT-Extension-TicketAging/t/03.dead-age.t Thu Sep 28 00:13:58 2006
@@ -8,7 +8,7 @@
BEGIN { require 't/utils.pl' }
RT::Init();
-diag("dead age") if $ENV{'TEST_VERBOSE'};
+verbose("dead age");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($id) = $ticket->Create( Queue => 'General', Status => 'resolved' );
@@ -29,7 +29,7 @@
is($ticket->FirstCustomFieldValue('Age'), 'Dead', 'correct age');
}
-diag("dead age: parent is finished while child is not") if $ENV{'TEST_VERBOSE'};
+verbose("dead age: parent is finished while child is not");
{
my $parent = RT::Ticket->new( $RT::SystemUser );
my ($pid) = $parent->Create( Queue => 'General', Status => 'resolved' );
@@ -60,7 +60,7 @@
is($child->LastUpdated, $date->ISO, 'set date' );
}
-diag("dead age: child is finished, but parent is not") if $ENV{'TEST_VERBOSE'};
+verbose("dead age: child is finished, but parent is not");
{
my $parent = RT::Ticket->new( $RT::SystemUser );
my ($pid) = $parent->Create( Queue => 'General' );
Modified: RT-Extension-TicketAging/t/04.extinct-age.t
==============================================================================
--- RT-Extension-TicketAging/t/04.extinct-age.t (original)
+++ RT-Extension-TicketAging/t/04.extinct-age.t Thu Sep 28 00:13:58 2006
@@ -9,13 +9,13 @@
RT::Init();
use_ok('RT::Extension::TicketAging');
-diag("simle test of the script") if $ENV{'TEST_VERBOSE'};
+verbose("simle test of the script");
{
my ($res, $err) = run_exec();
ok(!$err, 'no error') or diag("error: $err");
}
-diag("extinct age") if $ENV{'TEST_VERBOSE'};
+verbose("extinct age");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($id) = $ticket->Create( Queue => 'General', Status => 'resolved' );
@@ -36,7 +36,7 @@
is($ticket->FirstCustomFieldValue('Age'), 'Extinct', 'correct age');
is($ticket->Status, 'deleted', 'correct status');
- diag("extinct age: search") if $ENV{'TEST_VERBOSE'};
+ verbose("extinct age: search");
{
my $tickets = RT::Tickets->new( $RT::SystemUser );
$tickets->FromSQL("id = $id AND CF.{Age} = 'Extinct'");
Modified: RT-Extension-TicketAging/t/05.destroyed-age.t
==============================================================================
--- RT-Extension-TicketAging/t/05.destroyed-age.t (original)
+++ RT-Extension-TicketAging/t/05.destroyed-age.t Thu Sep 28 00:13:58 2006
@@ -8,7 +8,7 @@
BEGIN { require 't/utils.pl' }
RT::Init();
-diag("destroyed age") if $ENV{'TEST_VERBOSE'};
+verbose("destroyed age");
{
my $ticket = RT::Ticket->new( $RT::SystemUser );
my ($id) = $ticket->Create( Queue => 'General', Status => 'resolved' );
Modified: RT-Extension-TicketAging/t/utils.pl
==============================================================================
--- RT-Extension-TicketAging/t/utils.pl (original)
+++ RT-Extension-TicketAging/t/utils.pl Thu Sep 28 00:13:58 2006
@@ -47,3 +47,10 @@
return $msg;
}
+
+sub verbose {
+ return unless $ENV{TEST_VERBOSE};
+
+ my $msg = shift;
+ return diag($msg);
+}
More information about the Rt-commit
mailing list