Skip to content

Commit

Permalink
Test generated Makefile.PL output
Browse files Browse the repository at this point in the history
Confirm regexp bug observed in lib.
  • Loading branch information
rwstauner authored and rjbs committed Sep 1, 2014
1 parent 88bb4df commit c3009eb
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions t/makefile-pl.t
@@ -0,0 +1,36 @@
use strict;
use warnings;

use Test::More;

use Module::Faker::Dist;
use File::Temp ();
use Path::Class;

my @matches = (

[ qr/^ \s* NAME \s* => \s* "Provides::Inner::Sorted", \s* $/mx,
'Makefile.PL gets NAME that looks like a package' ],

);

plan tests => 2 + @matches;

my $MFD = 'Module::Faker::Dist';

my $tmpdir = File::Temp::tempdir(CLEANUP => 1);

my $dist = $MFD->from_file('./eg/Provides-Inner-Sorted.yml');

isa_ok($dist, $MFD);

my $dir = $dist->make_dist_dir({ dir => $tmpdir });

my $path = file($dir, 'Makefile.PL');
ok -e $path;

my $content = $path->slurp;

foreach my $match ( @matches ){
like $content, $match->[0], $match->[1];
}

0 comments on commit c3009eb

Please sign in to comment.