From b7b7c17b7a7a2eab5b82011cd49ce4223470deba Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 13 Jun 2010 10:46:21 -0500 Subject: add test for dzil integration --- t/02-dzil.t | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++ t/02/bugs.section | 5 +++ t/02/dist.ini | 8 ++++ t/02/lib/Foo/Bar.pm | 7 +++ t/02/lib/Foo/Baz.pm | 6 +++ t/02/support.section | 25 +++++++++++ t/02/weaver.ini | 8 ++++ 7 files changed, 180 insertions(+) create mode 100644 t/02-dzil.t create mode 100644 t/02/bugs.section create mode 100644 t/02/dist.ini create mode 100644 t/02/lib/Foo/Bar.pm create mode 100644 t/02/lib/Foo/Baz.pm create mode 100644 t/02/support.section create mode 100644 t/02/weaver.ini diff --git a/t/02-dzil.t b/t/02-dzil.t new file mode 100644 index 0000000..d312beb --- /dev/null +++ b/t/02-dzil.t @@ -0,0 +1,121 @@ +#!/usr/bin/env perl +use strict; +use warnings; +BEGIN { + unless (eval "require Dist::Zilla; require Dist::Zilla::Plugin::PodWeaver; 1") { + require Test::More; + Test::More::plan(skip_all => 'Dist::Zilla and Dist::Zilla::Plugin::PodWeaver are required for this test'); + } +} + +use Test::More; + +use Dist::Zilla::Tester; +use FindBin; +use Path::Class; +use Pod::Elemental; +use Pod::Weaver; +use lib "$FindBin::Bin/../lib"; + +my $zilla = Dist::Zilla::Tester->from_config({ + dist_root => dir($FindBin::Bin, '02'), +}); +$zilla->build; + +chdir $zilla->tempdir->subdir('build'); +is(file('lib', 'Foo', 'Bar.pm')->slurp, <<'PM', "got the right Bar.pm file contents"); +package Foo::Bar; +# ABSTRACT: turns trinkets into baubles + +sub bar { +} + +1; + +__END__ +=pod + +=head1 BUGS + +No known bugs. + +Please report any bugs through RT: email +C, or browse to +L. + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc Foo::Bar + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back + +=cut + +PM + +is(file('lib', 'Foo', 'Baz.pm')->slurp, <<'PM', "got the right Baz.pm file contents"); +package Foo::Baz; + +sub baz { +} + +1; + +__END__ +=pod + +=head1 SUPPORT + +You can find this documentation for this module with the perldoc command. + + perldoc Foo::Bar + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back + +=cut + +PM + +done_testing; diff --git a/t/02/bugs.section b/t/02/bugs.section new file mode 100644 index 0000000..c633fe4 --- /dev/null +++ b/t/02/bugs.section @@ -0,0 +1,5 @@ +No known bugs. + +Please report any bugs through RT: email +C, or browse to +L. diff --git a/t/02/dist.ini b/t/02/dist.ini new file mode 100644 index 0000000..7f68ce8 --- /dev/null +++ b/t/02/dist.ini @@ -0,0 +1,8 @@ +name = Foo-Bar +version = 0.01 +author = Jesse Luehrs +license = Perl_5 +copyright_holder = Jesse Luehrs + +[GatherDir] +[PodWeaver] diff --git a/t/02/lib/Foo/Bar.pm b/t/02/lib/Foo/Bar.pm new file mode 100644 index 0000000..ae80734 --- /dev/null +++ b/t/02/lib/Foo/Bar.pm @@ -0,0 +1,7 @@ +package Foo::Bar; +# ABSTRACT: turns trinkets into baubles + +sub bar { +} + +1; diff --git a/t/02/lib/Foo/Baz.pm b/t/02/lib/Foo/Baz.pm new file mode 100644 index 0000000..2e01b8d --- /dev/null +++ b/t/02/lib/Foo/Baz.pm @@ -0,0 +1,6 @@ +package Foo::Baz; + +sub baz { +} + +1; diff --git a/t/02/support.section b/t/02/support.section new file mode 100644 index 0000000..1f4c42b --- /dev/null +++ b/t/02/support.section @@ -0,0 +1,25 @@ +You can find this documentation for this module with the perldoc command. + + perldoc {{ $main_module_name }} + +You can also look for information at: + +=over 4 + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * RT: CPAN's request tracker + +L + +=item * Search CPAN + +L + +=back diff --git a/t/02/weaver.ini b/t/02/weaver.ini new file mode 100644 index 0000000..bc813e5 --- /dev/null +++ b/t/02/weaver.ini @@ -0,0 +1,8 @@ +[@CorePrep] + +[Template / BUGS] +template = ../../../t/02/bugs.section +main_module_only = 1 + +[Template / SUPPORT] +template = ../../../t/02/support.section -- cgit v1.2.3