Async-Trampoline
view release on metacpan or search on metacpan
t/lib/Async/Trampoline/Describe.pm view on Meta::CPAN
use strict;
use warnings;
use utf8;
## no critic (ProhibitSubroutinePrototypes)
package Async::Trampoline::Describe;
=head1 NAME
Async::Trampoline::Describe - describe/it testing function
=head1 DESCRIPTION
=cut
use Test::More;
use Exporter 'import';
our @EXPORT = qw/
describe
it
/;
our $_PATH;
=head2 describe
describe q(name) => sub {
...
};
=cut
sub describe($&) {
my ($what, $test) = @_;
local $_PATH = (defined $_PATH) ? "$_PATH\::$what" : $what;
@_ = ($_PATH, $test);
goto &subtest;
}
=head2 it
it q(does something interesting) => sub {
...
};
=cut
sub it($&) {
my ($behaves, $test) = @_;
local $_PATH = (defined $_PATH) ? "$_PATH $behaves" : "it $behaves";
@_ = ($_PATH, $test);
goto &subtest;
}
1;
__END__
=head1 NAME
Async::Trampoline::Describe - describe/it testing functions
=cut
( run in 1.735 second using v1.01-cache-2.11-cpan-84e82930d8c )