Permalink
Browse files

Basic tests

  • Loading branch information...
1 parent 1768d7a commit 6aad3662a9542ea899f6bef355a3e4f60a2578ac @sartak sartak committed Aug 22, 2011
Showing with 66 additions and 0 deletions.
  1. +2 −0 Makefile.PL
  2. +28 −0 t/basic.t
  3. +14 −0 t/corpus/bad-pod.pm
  4. +14 −0 t/corpus/good-pod.pm
  5. +8 −0 t/corpus/no-pod.pm
View
@@ -8,6 +8,8 @@ all_from 'lib/Test/Spelling.pm';
githubmeta;
requires 'Pod::Spell' => '1.01';
+test_requires 'Test::More' => '0.88';
+test_requires 'Test::Tester';
manifest_skip;
auto_manifest;
View
@@ -0,0 +1,28 @@
+use Test::Tester;
+use Test::More;
+use Test::Spelling;
+
+BEGIN {
+ if (!has_working_spellchecker()) {
+ plan skip_all => "no working spellchecker found";
+ }
+}
+
+check_test(sub { pod_file_spelling_ok('t/corpus/no-pod.pm', 'no pod has no errors') }, {
+ ok => 1,
+ name => 'no pod has no errors',
+});
+
+check_test(sub { pod_file_spelling_ok('t/corpus/good-pod.pm', 'good pod has no errors') }, {
+ ok => 1,
+ name => 'good pod has no errors',
+});
+
+check_test(sub { pod_file_spelling_ok('t/corpus/bad-pod.pm', 'bad pod has no errors') }, {
+ ok => 0,
+ name => 'bad pod has no errors',
+ diag => "Errors:\n incorectly",
+});
+
+done_testing;
+
View
@@ -0,0 +1,14 @@
+package Bad::Pod;
+use strict;
+use warnings;
+
+sub foo {}
+
+__END__
+
+=head1 NAME
+
+Bad::Pod - incorectly spelled POD
+
+=END
+
View
@@ -0,0 +1,14 @@
+package Good::Pod;
+use strict;
+use warnings;
+
+sub foo {}
+
+__END__
+
+=head1 NAME
+
+Good::Pod - correctly spelled POD
+
+=END
+
View
@@ -0,0 +1,8 @@
+package No::Pod;
+use strict;
+use warnings;
+
+sub foo {}
+
+__END__
+

0 comments on commit 6aad366

Please sign in to comment.