[Module-build-checkins] Module-Build/t metadata2.t,1.4,1.5
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <si...@us...> - 2005-10-20 22:13:50
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5495/t Modified Files: metadata2.t Log Message: Skip a few tests that require YAML unless it is installed. Also, avoid some warnings in other tests when YAML is not installed. Index: metadata2.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/metadata2.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- metadata2.t 20 Oct 2005 16:45:19 -0000 1.4 +++ metadata2.t 20 Oct 2005 22:13:41 -0000 1.5 @@ -21,45 +21,33 @@ ############################## ACTION distmeta works without a MANIFEST file -my $dist = DistGen->new( dir => $tmp, skip_manifest => 1 ); -$dist->regen; - -chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; - -ok ! -e 'MANIFEST'; - -my $mb = Module::Build->new_from_context; +SKIP: { + skip( 'YAML_support feature is not enabled', 4 ) + unless Module::Build->current->feature('YAML_support'); -my $out; -$out = eval { stderr_of(sub{$mb->dispatch('distmeta')}) }; -is $@, ''; + my $dist = DistGen->new( dir => $tmp, skip_manifest => 1 ); + $dist->regen; -like $out, qr/Nothing to enter for 'provides'/; + chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -ok -e 'META.yml'; + ok ! -e 'MANIFEST'; -chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; -$dist->remove; + my $mb = Module::Build->new_from_context; + my $out; + $out = eval { stderr_of(sub{$mb->dispatch('distmeta')}) }; + is $@, ''; -############################## Check generation of README file + like $out, qr/Nothing to enter for 'provides'/; -$dist = DistGen->new( dir => $tmp ); + ok -e 'META.yml'; -$dist->change_file( 'Build.PL', <<"---" ); -use Module::Build; -my \$builder = Module::Build->new( - module_name => '@{[$dist->name]}', - dist_version => '3.14159265', - license => 'perl', - create_readme => 1, -); + chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; + $dist->remove; +} -\$builder->create_build_script(); ---- -$dist->regen; -chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; +############################## Check generation of README file my $provides; # Used a bunch of times below @@ -87,7 +75,25 @@ } -# .pm File with pod +my $dist = DistGen->new( dir => $tmp ); + +$dist->change_file( 'Build.PL', <<"---" ); +use Module::Build; +my \$builder = Module::Build->new( + module_name => '@{[$dist->name]}', + dist_version => '3.14159265', + license => 'perl', + create_readme => 1, +); + +\$builder->create_build_script(); +--- +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; + + +# .pm File with pod # $dist->change_file( 'lib/Simple.pm', <<'---' . $pod_text); @@ -96,8 +102,8 @@ --- $dist->regen( clean => 1 ); ok( -e "lib/Simple.pm", "Creating Simple.pm" ); -$mb = Module::Build->new_from_context; -$mb->dispatch('distmeta'); +my $mb = Module::Build->new_from_context; +$mb->do_create_readme; like( _slurp("README"), qr/NAME/, "Generating README from .pm"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', @@ -118,7 +124,7 @@ ok( -e "lib/Simple.pm", "Creating Simple.pm" ); ok( -e "lib/Simple.pod", "Creating Simple.pod" ); $mb = Module::Build->new_from_context; -$mb->dispatch('distmeta'); +$mb->do_create_readme; like( _slurp("README"), qr/NAME/, "Generating README from .pod"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', "Extracting AUTHOR from .pod"); @@ -143,7 +149,7 @@ ok( -e "lib/Simple.pm", "Creating Simple.pm" ); ok( -e "lib/Simple.pod", "Creating Simple.pod" ); $mb = Module::Build->new_from_context; -$mb->dispatch('distmeta'); +$mb->do_create_readme; like( _slurp("README"), qr/NAME/, "Generating README from .pod over .pm"); is( $mb->dist_author->[0], 'Simple Simon <si...@si...m>', "Extracting AUTHOR from .pod over .pm"); |