Aspect-Library-TestClass
view release on metacpan or search on metacpan
lib/Aspect/Library/TestClass.pm view on Meta::CPAN
$_->args( $_->args, $subject );
},
);
}
1;
__END__
=pod
=head1 NAME
Aspect::Library::TestClass - give Test::Class test methods an IUT
(implementation under test)
=head1 SYNOPSIS
# append IUT to params of all test methods in matching packages
# place this in your test script
aspect TestClass => call qr/::tests::/;
=head1 SUPER
L<Aspect::Modular>
=head1 DESCRIPTION
Frequently my C<Test::Class> test methods look like this:
sub some_test: Test {
my $self = shift;
my $subject = IUT->new;
# send $subject messages and verify expected results
...
}
After installing this aspect, they look like this:
sub some_test: Test {
my ($self, $subject) = @_;
# send $subject messages and verify expected results
...
}
In the test class you must add one I<template method> to provide the
class of the IUT:
sub subject_class { 'MyApp::Person' }
=head1 REQUIRES
Only works with C<Test::Class> above version C<0.06_05>.
=head1 SEE ALSO
See the L<Aspect|::Aspect> pods for a guide to the Aspect module.
C<XUL-Node> tests use this aspect extensively.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests through the web interface at
L<http://rt.cpan.org>.
=head1 SUPPORT
Bugs should be reported via the CPAN bug tracker at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Aspect-Library-TestClass>
For other issues, contact the author.
=head1 INSTALLATION
See perlmodinstall for information and options on installing Perl modules.
=head1 AVAILABILITY
The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN
site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.
=head1 AUTHORS
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
Marcel GrE<uuml>nauer E<lt>marcel@cpan.orgE<gt>
Ran Eilam E<lt>eilara@cpan.orgE<gt>
=head1 SEE ALSO
You can find AOP examples in the C<examples/> directory of the
distribution.
=head1 COPYRIGHT AND LICENSE
Copyright 2001 by Marcel GrE<uuml>nauer
Some parts copyright 2009 - 2011 Adam Kennedy.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
( run in 0.633 second using v1.01-cache-2.11-cpan-df04353d9ac )