Skip to content

Commit

Permalink
- hack hack hack
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/david/.svk/local/mirror/dagolden/Test-Filenames/trunk@4210 5eb9f33a-0d21-0410-bbf2-8fdb37bc7dbf
  • Loading branch information
xdg committed Oct 6, 2007
1 parent ab399d9 commit accef33
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 28 deletions.
3 changes: 3 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ $class->new(
'File::Spec' => 3.19,
'Test::More' => 0.62, # various features/fixes
},
build_requires => {
'Test::Tester' => 0.08,
},
meta_add => {
no_index => {
directory => [ qw{
Expand Down
44 changes: 43 additions & 1 deletion lib/Test/Filenames.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,56 @@ use strict;

$Test::Filenames::VERSION = '0.01';

use File::Basename qw/basename/;
use Test::Builder;
use File::Basename qw/basename/;
use File::Spec::Functions qw/canonpath/;

use vars qw/@ISA @EXPORT/;
use Exporter ();
BEGIN { @ISA = qw/Exporter/ }
@EXPORT = qw(
filename_is
filename_isnt
filename_like
filename_unlike
);

my $TB = Test::Builder->new();

#--------------------------------------------------------------------------#
# import -- cribbed from Test::Builder
#--------------------------------------------------------------------------#

sub import {
my ($self, @args) = @_;
my $pack = caller;

$Test->exported_to($pack);
$Test->plan(@_);

$self->export_to_level(1, $self, $_) for @EXPORT;
}

#--------------------------------------------------------------------------#
# public API
#--------------------------------------------------------------------------#

sub filename_is {

}

sub filename_isnt {

}

sub filename_like {

}

sub filename_unlike {

}

#--------------------------------------------------------------------------#
# private functions
#--------------------------------------------------------------------------#
Expand Down
40 changes: 13 additions & 27 deletions t/00_load.t
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
# CPAN::Reporter tests
use strict;
BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } }

select(STDERR); $|=1;
select(STDOUT); $|=1;

use Test::More;
use t::Helper;
use t::Frontend;

#--------------------------------------------------------------------------#
# Bailout if we're on a broken dev version of Test::Harness
#--------------------------------------------------------------------------#
require Test::Harness;
if ( $Test::Harness::VERSION eq "2.99_01" ) {
warn "Detected Test::Harness 2.99_01\n";
BAIL_OUT("Your Test::Harness conflicts with CPAN::Reporter")
}
my @api = qw(
filename_is
filename_isnt
filename_like
filename_unlike
);

plan tests => 1 + 2 * @api;

#--------------------------------------------------------------------------#

my @api = qw(
configure
grade_PL
grade_make
grade_test
record_command
test
);
require_ok( 'Test::Filename' );

my @modules = qw(
CPAN::Reporter
CPAN::Reporter::Config
CPAN::Reporter::History
);
can_ok( 'Test::Filename', $_ ) for @api;

plan tests => @api + @modules;
package Foo;

require_ok( $_ ) for @modules;
Test::Filename->import();

can_ok( 'CPAN::Reporter', $_ ) for @api;
can_ok( 'Foo', $_ ) for @api;

9 changes: 9 additions & 0 deletions t/filename_is.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use strict;
BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } }

select(STDERR); $|=1;
select(STDOUT); $|=1;

use Test::More;


0 comments on commit accef33

Please sign in to comment.