[Bps-public-commit] RT-Extension-CommandByMail branch, master, updated. 0.09-5-g324497c
Kevin Falcone
falcone at bestpractical.com
Wed Aug 3 12:56:49 EDT 2011
The branch, master has been updated
via 324497c64218b9db55adac28240bf4b90d7a2002 (commit)
from 6cd5de5f4e85b25d8f522ea920ce8e317e42fb64 (commit)
Summary of changes:
META.yml | 2 +-
Makefile.PL | 3 +-
inc/Module/Install/AuthorTests.pm | 59 +++++++++++++++++++++++++++++++++++++
{t => xt}/00.load.t | 2 +-
{t => xt}/01.internals.t | 2 +-
{t => xt}/02.create.t | 2 +-
{t => xt}/03.update.t | 2 +-
{t => xt}/04.send.t | 2 +-
{t => xt}/pod-coverage.t | 0
{t => xt}/pod.t | 0
{t => xt}/utils.pl | 0
11 files changed, 67 insertions(+), 7 deletions(-)
create mode 100644 inc/Module/Install/AuthorTests.pm
rename {t => xt}/00.load.t (96%)
rename {t => xt}/01.internals.t (99%)
rename {t => xt}/02.create.t (99%)
rename {t => xt}/03.update.t (99%)
rename {t => xt}/04.send.t (97%)
rename {t => xt}/pod-coverage.t (100%)
rename {t => xt}/pod.t (100%)
rename {t => xt}/utils.pl (100%)
- Log -----------------------------------------------------------------
commit 324497c64218b9db55adac28240bf4b90d7a2002
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Wed Aug 3 12:42:41 2011 -0400
Switch these to author tests
If the cpan shell tries to run these, they'll connect to your live
database and webserver and start making tickets by invoking mailgate
diff --git a/META.yml b/META.yml
index 0e93722..0002892 100644
--- a/META.yml
+++ b/META.yml
@@ -19,7 +19,7 @@ name: RT-Extension-CommandByMail
no_index:
directory:
- inc
- - t
+ - xt
requires:
MIME::Entity: 5.420
UNIVERSAL::require: 0
diff --git a/Makefile.PL b/Makefile.PL
index a2b4d1f..24b59d1 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -25,9 +25,10 @@ substitute(
RT_BIN_PATH => $bin_path,
RT_SBIN_PATH => $sbin_path,
},
- qw(t/utils.pl),
+ qw(xt/utils.pl),
);
+author_tests('xt');
sign;
WriteAll();
diff --git a/inc/Module/Install/AuthorTests.pm b/inc/Module/Install/AuthorTests.pm
new file mode 100644
index 0000000..c44931b
--- /dev/null
+++ b/inc/Module/Install/AuthorTests.pm
@@ -0,0 +1,59 @@
+#line 1
+package Module::Install::AuthorTests;
+
+use 5.005;
+use strict;
+use Module::Install::Base;
+use Carp ();
+
+#line 16
+
+use vars qw{$VERSION $ISCORE @ISA};
+BEGIN {
+ $VERSION = '0.002';
+ $ISCORE = 1;
+ @ISA = qw{Module::Install::Base};
+}
+
+#line 42
+
+sub author_tests {
+ my ($self, @dirs) = @_;
+ _add_author_tests($self, \@dirs, 0);
+}
+
+#line 56
+
+sub recursive_author_tests {
+ my ($self, @dirs) = @_;
+ _add_author_tests($self, \@dirs, 1);
+}
+
+sub _wanted {
+ my $href = shift;
+ sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
+}
+
+sub _add_author_tests {
+ my ($self, $dirs, $recurse) = @_;
+ return unless $Module::Install::AUTHOR;
+
+ my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
+
+ # XXX: pick a default, later -- rjbs, 2008-02-24
+ my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
+ @dirs = grep { -d } @dirs;
+
+ if ($recurse) {
+ require File::Find;
+ my %test_dir;
+ File::Find::find(_wanted(\%test_dir), @dirs);
+ $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
+ } else {
+ $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
+ }
+}
+
+#line 107
+
+1;
diff --git a/t/00.load.t b/xt/00.load.t
similarity index 96%
rename from t/00.load.t
rename to xt/00.load.t
index d2872a7..b9375ae 100644
--- a/t/00.load.t
+++ b/xt/00.load.t
@@ -1,6 +1,6 @@
use Test::More tests => 5;
-BEGIN { require 't/utils.pl' }
+BEGIN { require 'xt/utils.pl' }
BEGIN {
use_ok( 'RT' );
RT::LoadConfig();
diff --git a/t/01.internals.t b/xt/01.internals.t
similarity index 99%
rename from t/01.internals.t
rename to xt/01.internals.t
index 7efb29c..f56a593 100644
--- a/t/01.internals.t
+++ b/xt/01.internals.t
@@ -5,7 +5,7 @@ use warnings;
use Test::More tests => 24;
-BEGIN { require 't/utils.pl' }
+BEGIN { require 'xt/utils.pl' }
use_ok('RT');
RT::LoadConfig();
diff --git a/t/02.create.t b/xt/02.create.t
similarity index 99%
rename from t/02.create.t
rename to xt/02.create.t
index 19e4141..8463b57 100644
--- a/t/02.create.t
+++ b/xt/02.create.t
@@ -5,7 +5,7 @@ use warnings;
use Test::More tests => 144;
-BEGIN { require 't/utils.pl' }
+BEGIN { require 'xt/utils.pl' }
RT::Init();
my $test_ticket_id;
diff --git a/t/03.update.t b/xt/03.update.t
similarity index 99%
rename from t/03.update.t
rename to xt/03.update.t
index be08580..3f6253a 100644
--- a/t/03.update.t
+++ b/xt/03.update.t
@@ -5,7 +5,7 @@ use warnings;
use Test::More tests => 134;
-BEGIN { require 't/utils.pl' }
+BEGIN { require 'xt/utils.pl' }
RT::Init();
my $test_ticket_id;
diff --git a/t/04.send.t b/xt/04.send.t
similarity index 97%
rename from t/04.send.t
rename to xt/04.send.t
index 9c1f4c3..e410d2c 100644
--- a/t/04.send.t
+++ b/xt/04.send.t
@@ -7,7 +7,7 @@ use Test::More tests => 1;
use File::Temp qw/ tempfile tempdir /;
-BEGIN { require 't/utils.pl' }
+BEGIN { require 'xt/utils.pl' }
RT::Init;
diag("test errors via mailgate") if $ENV{'TEST_VERBOSE'};
diff --git a/t/pod-coverage.t b/xt/pod-coverage.t
similarity index 100%
rename from t/pod-coverage.t
rename to xt/pod-coverage.t
diff --git a/t/pod.t b/xt/pod.t
similarity index 100%
rename from t/pod.t
rename to xt/pod.t
diff --git a/t/utils.pl b/xt/utils.pl
similarity index 100%
rename from t/utils.pl
rename to xt/utils.pl
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list