Commit 324497c6 authored by Kevin Falcone's avatar Kevin Falcone
Browse files

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
parent 6cd5de5f
......@@ -19,7 +19,7 @@ name: RT-Extension-CommandByMail
no_index:
directory:
- inc
- t
- xt
requires:
MIME::Entity: 5.420
UNIVERSAL::require: 0
......
......@@ -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();
#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;
use Test::More tests => 5;
BEGIN { require 't/utils.pl' }
BEGIN { require 'xt/utils.pl' }
BEGIN {
use_ok( 'RT' );
RT::LoadConfig();
......
......@@ -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();
......
......@@ -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;
......
......@@ -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;
......
......@@ -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'};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment