diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-11 22:32:06 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-11 22:32:06 +0000 |
commit | 467298a34215401cdcbb1dded51bc2aba5f1f41c (patch) | |
tree | 1923f32fbc9cf8f0b4ab291d1eb9fad5ab872d68 /t/test_reqs.t | |
download | Module-Build-tarball-master.tar.gz |
Module-Build-0.4214HEADModule-Build-0.4214master
Diffstat (limited to 't/test_reqs.t')
-rw-r--r-- | t/test_reqs.t | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/t/test_reqs.t b/t/test_reqs.t new file mode 100644 index 0000000..bd04f86 --- /dev/null +++ b/t/test_reqs.t @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w + +use strict; +use lib 't/lib'; +use MBTest; +use CPAN::Meta 2.110420; +use CPAN::Meta::YAML; +use Parse::CPAN::Meta 1.4401; +plan tests => 4; + +blib_load('Module::Build'); + +my $tmp = MBTest->tmpdir; + +use DistGen; +my $dist = DistGen->new( dir => $tmp ); +$dist->change_file('Build.PL', <<"---"); +use strict; +use Module::Build; + +my \$builder = Module::Build->new( + module_name => '$dist->{name}', + license => 'perl', + requires => { + 'File::Spec' => 0, + }, + test_requires => { + 'Test::More' => 0, + } +); + +\$builder->create_build_script(); +--- +$dist->regen; +$dist->chdir_in; +$dist->run_build_pl; +my $output = stdout_stderr_of sub { $dist->run_build('distmeta') }; + +for my $file ( qw/MYMETA META/ ) { + my $meta = Parse::CPAN::Meta->load_file($file.".json"); + is_deeply($meta->{prereqs}->{runtime},{ + requires => { + 'File::Spec' => '0', + } + }, "runtime prereqs in $file"); + is_deeply($meta->{prereqs}->{test},{ + requires => { + 'Test::More' => '0', + } + }, "test prereqs in $file"); +} + |