[libdist-zilla-plugin-test-podspelling-perl] 03/05: Test content generated by different attributes
Axel Beckert
abe at deuxchevaux.org
Mon May 25 10:02:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 2.001004
in repository libdist-zilla-plugin-test-podspelling-perl.
commit ebfafaaf9d24d053461373778af4d4692f51b0e0
Author: Randy Stauner <randy at magnificent-tears.com>
Date: Mon Dec 12 21:01:21 2011 -0700
Test content generated by different attributes
---
t/attributes.t | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/t/attributes.t b/t/attributes.t
new file mode 100644
index 0000000..f3c22de
--- /dev/null
+++ b/t/attributes.t
@@ -0,0 +1,55 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More 0.88;
+use Test::DZil;
+
+# test the file content generated when various attributes are set
+
+my $author = 'Fooer';
+
+sub get_content {
+ my ($args) = @_;
+
+ my $name = 'Test::PodSpelling';
+ my $zilla = Builder->from_config(
+ { dist_root => 'corpus/foo' },
+ {
+ add_files => {
+ 'source/dist.ini' => dist_ini(
+ {
+ name => 'Spell-Checked',
+ version => 1,
+ abstract => 'spelled wrong',
+ license => 'Perl_5',
+ author => $author,
+ copyright_holder => $author,
+ },
+ [$name => $args],
+ )
+ }
+ }
+ );
+
+ my $plugin = $zilla->plugin_named($name);
+ $plugin->gather_files;
+ return $zilla->files->[0]->content;
+}
+
+my $content = get_content({});
+ like $content, qr/use Pod::Wordlist::hanekomu/, q[use default wordlist];
+unlike $content, qr/set_spell_cmd/, q[by default don't set spell command];
+ like $content, qr/add_stopwords/, q[by default we add stopwords];
+ like $content, qr/__DATA__\s$author/, q[DATA handle includes author];
+
+$content = get_content({wordlist => 'Foo::Bar'});
+unlike $content, qr/use Pod::Wordlist::hanekomu/, q[custom word list];
+ like $content, qr/use Foo::Bar/, q[custom word list];
+
+$content = get_content({spell_cmd => 'all_wrong'});
+ like $content, qr/set_spell_cmd.+all_wrong/, q[custom spell checker];
+
+$content = get_content({stopwords => 'foohoo'});
+ like $content, qr/__DATA__\s(.*\s)*foohoo\b/, q[add stopwords];
+
+done_testing;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-test-podspelling-perl.git
More information about the Pkg-perl-cvs-commits
mailing list