Navigation Menu

Skip to content

Commit

Permalink
Added tests for Module::Build support
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanrogers committed Sep 20, 2012
1 parent ed316af commit f7a799f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
16 changes: 16 additions & 0 deletions corpus/DZ3/dist.ini
@@ -0,0 +1,16 @@
name = DZ3
version = 0.001
author = E. Xavier Ample <example@example.org>
license = Perl_5
copyright_holder = E. Xavier Ample

[@Filter]
bundle = @FakeClassic
remove = ConfirmRelease
remove = FakeRelease
remove = MakeMaker

[ModuleBuild]
[OSPrereqs / MSWin32]
Win32API::File = 0.11

10 changes: 10 additions & 0 deletions corpus/DZ3/lib/DZ3.pm
@@ -0,0 +1,10 @@
use strict;
use warnings;
package DZ1;
# ABSTRACT: this is a sample package for testing Dist::Zilla;

sub main {
return 1;
}

1;
28 changes: 28 additions & 0 deletions t/osprereqs_mb.t
@@ -0,0 +1,28 @@
use strict;
use warnings;

use lib 't/lib';

use Test::More 0.88;
use Path::Class;

use Test::DZil;

my $tzil = Builder->from_config(
{ dist_root => 'corpus/DZ3' },
);

$tzil->build;

my $contents = $tzil->slurp_file('build/Build.PL');

my $conditional = q|if ( $^O eq 'MSWin32' ) {|;
my $prereq = q|$module_build_args{requires}{'Win32API::File'} = '0.11'|;

like($contents, qr/\Q$conditional\E.*?\Q$prereq\E.*?^\}/ms, "saw MSWin32 conditional");

my $meta = $tzil->slurp_file('build/META.yml');
like($meta, qr/dynamic_config: +1/, "dynamic_config is true in META.yml");

done_testing;

0 comments on commit f7a799f

Please sign in to comment.