Skip to content

Commit

Permalink
Tests, mostly 'Did it do SOMETHING?'
Browse files Browse the repository at this point in the history
  • Loading branch information
davehouston committed Dec 4, 2010
1 parent 801a1db commit a609475
Showing 1 changed file with 56 additions and 7 deletions.
63 changes: 56 additions & 7 deletions t/main.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,66 @@ use Pod::Weaver;
use lib qw(t/inc);

# Make some 'test' documents..
my $doc = PPI::Document->new('t/inc/Tester.pm');
my $weaver = Pod::Weaver->new_from_config({ root => 't'});


my $document = $weaver->weave_document({
my $doc = new_ok( 'PPI::Document', ['t/inc/Tester.pm']);
my $weaver;
ok( $weaver = Pod::Weaver->new_from_config({ root => 't'}) );
ok( my $document = $weaver->weave_document({
ppi_document => $doc,
mopper => {
no_tagline => 1
},
authors => ['Bob MctestAthor']
});
}), 'Weaving document..');

my $expected = <<HERE;
=pod
=head1 NAME
Tester
=head1 ATTRIBUTES
=head2 testattr1
Reader: testattr1
Writer: testattr1
Type: Str
=head2 testattr2
Reader: testattr2
Type: Num
Additional documentation: This is a documentation option test. It is a string. With some L<links>
=head1 METHODS
=head2 testattr1
Method originates in Tester.
=head2 testattr2
Method originates in Tester.
=head2 new
Method originates in Tester.
=head2 method1
Method originates in Tester.
=head1 AUTHOR
Bob MctestAthor
=cut
HERE

note $document->as_pod_string;
is( $document->as_pod_string, $expected, 'Did it work?');
done_testing;

0 comments on commit a609475

Please sign in to comment.