Venus::Test

Test Automation

Test Automation for Perl 5

function: test method: data method: for method: pdml method: render method: text

package main;

use Venus::Test;

my $test = test 't/Venus_Test.t';

# $test->for('name');

This package aims to provide a standard for documenting Venus derived software projects, a framework writing tests, test automation, and documentation generation.

Venus::Data

Venus::Role::Buildable

The test function is exported automatically and returns a Venus::Test object for the test file given.

test(Str $file) (Test)

{ since => '0.09', }

=example-1 test

package main;

use Venus::Test;

my $test = test 't/Venus_Test.t';

# bless( { ..., 'value' => 't/Venus_Test.t' }, 'Venus::Test' )

The data method attempts to find and return the POD content based on the name provided. If the content cannot be found an exception is raised.

data(Str $name, Any @args) (Str)

{ since => '0.09', }

=example-1 data

# given: synopsis

my $data = $test->data('name');

# Venus::Test

The for method attempts to find the POD content based on the name provided and executes the corresponding predefined test, optionally accepting a callback which, if provided, will be passes a Venus::Try object containing the POD-driven test. The callback, if provided, must always return a true value. Note: All automated tests disable the "redefine" class of warnings to prevent warnings when redeclaring packages in examples.

for(Str $name | CodeRef $code, Any @args) Any

{ since => '0.09', }

=example-1 for

# given: synopsis

my $data = $test->for('name');

# Venus::Test

The pdml method attempts to find the POD content based on the name provided and return a POD string for use in documentation.

pdml(Str $name | CodeRef $code, Any @args) Str

{ since => '0.09', }

=example-1 pdml

# given: synopsis

my $pdml = $test->pdml('name');

# =head1 NAME
#
# Venus::Test - Test Automation
#
# =cut

The render method returns a string representation of a valid POD document.

render(Str $file) Path

{ since => '0.09', }

=example-1 render

# given: synopsis

my $path = $test->render('t/Test_Venus.pod');

# =over 4
#
# =item data example 1
#
#   # given: synopsis
#
#   my $data = $test->data(\'name\');
#
#   # Venus::Test
#
# =back

The text method attempts to find and return the POD content based on the name provided. If the content cannot be found an empty string is returned. If the POD block is not recognized, an exception is raised.

text(Str $name, Any @args) (Str)

{ since => '0.09', }

=example-1 text

# given: synopsis

my $text = $test->text('name');

# Venus::Test

t/Venus.t: pdml: authors

t/Venus.t: pdml: authors t/Venus.t: pdml: license

36 POD Errors

The following errors were encountered while parsing the POD:

Around line 13:

Unknown directive: =name

Around line 21:

Unknown directive: =tagline

Around line 29:

Unknown directive: =abstract

Around line 37:

Unknown directive: =includes

Around line 50:

Unknown directive: =synopsis

Around line 70:

Unknown directive: =description

Around line 80:

Unknown directive: =inherits

Around line 88:

Unknown directive: =integrates

Around line 96:

Unknown directive: =function

Around line 101:

Unknown directive: =signature

Around line 105:

Unknown directive: =metadata

Around line 131:

Unknown directive: =method

Around line 136:

Unknown directive: =signature

Around line 140:

Unknown directive: =metadata

Around line 172:

=cut found outside a pod block. Skipping to next block.

Around line 183:

Unknown directive: =method

Around line 192:

Unknown directive: =signature

Around line 196:

Unknown directive: =metadata

Around line 220:

=cut found outside a pod block. Skipping to next block.

Around line 236:

=cut found outside a pod block. Skipping to next block.

Around line 246:

Unknown directive: =method

Around line 251:

Unknown directive: =signature

Around line 255:

Unknown directive: =metadata

Around line 303:

=cut found outside a pod block. Skipping to next block.

Around line 336:

=cut found outside a pod block. Skipping to next block.

Around line 351:

Unknown directive: =method

Around line 355:

Unknown directive: =signature

Around line 359:

Unknown directive: =metadata

Around line 394:

Unknown directive: =method

Around line 400:

Unknown directive: =signature

Around line 404:

Unknown directive: =metadata

Around line 441:

=cut found outside a pod block. Skipping to next block.

Around line 464:

=cut found outside a pod block. Skipping to next block.

Around line 481:

=cut found outside a pod block. Skipping to next block.

Around line 492:

Unknown directive: =partials

Around line 500:

Unknown directive: =partials