NAME

Fennec - Workflow based testing framework for Perl.

DESCRIPTION

Fennec is a workflow based testing framework for Perl. It is designed to be easy to use, easy to extend, and to provide an incredible array of tools while staying out of your way. Fennec provides everything your used to in Perl testing framework along with enhancements inspired from other frameworks.

Fennec works just like traiditional Test::Builder tools in that it allows you to write script style tests. Fennec takes this a step further by introducing behavior driven development with the concepts of test groups and workflows. Fennec also requires that each test file define a class which Fennec will instantiate.

Please see these docs for additional details:

Fennec::Manual::Quickstart
Fennec::Manual::User

SYNOPSIS

t/MyModule.t:

package TEST::MyModule;
use strict;
use warnings;
use Fennec::Standalone;

use_or_skip 'Dependancy::Module';

use_ok 'MyModule';

# Put the name of the module we are testing in the stash (not required, but
# good practice for plugin use.)
S( testing => 'MyModule' );

tests simple {
    can_ok( S('testing'), 'new' );
    isa_ok( S('testing')->new(), s('testing' ));
    dies_ok { S('testing')->Thing_that_dies } "thing dies";
    warning_like { S('testing')->Thing_that_warns } qr/.../, "thing warns";

    is_deeply( ... );
    ...
}

describe 'RSPEC Tests' {
    # Automatically get $self
    before_each { $self->do_something }
    after_each { $self->do_something_else }

    it test_one {
        ok( 1, "1 is true!" )
    }

    describe nested { ... };
}

cases some_primes {
    my $var;
    case two { $var = 2 }
    case three { $var = 3 }

    tests is_prime {
        ok( is_prime($var), "var is prime" )
    }
}

done_testing;

MANUAL

Fennec::Manual::Quickstart

The quick guide to using Fennec.

Fennec::Manual::User

The extended guide to using Fennec.

Fennec::Manual::Developer

The guide to developing and extending Fennec.

Fennec::Manual

Documentation guide.

FEATURES

Fennec offers the following features, among others.

Declarative syntax
Large library of core assert functions
Plays nicely with Test::Builder tools
Better diagnostics
Highly Extendable
Works with prove
Full-Suite management
Standalone test support
Support for SPEC and other test workflows
Forking just works
Run only specific test sets within test files (for development)
Intercept or hook into most steps or components by design
No large dependancy chains
No attributes (none of these: http://perldoc.perl.org/attributes.html)
No use of END blocks
No use of Sub::Uplevel
No source filters

MISSION

Fennec::Mission - Why does Fennec exist?

API DOCUMENTATION

API Documentation covers object internals. See the POD within each individual module.

FENNEC MODULE API

This section only covers the API for Fennec.pm. See Fennec::Manual and other documentation for other module API's.

This section is not for those who simply wish to write tests, this is for people who want to extend Fennec.

Class methods

import( %proto )
use Fennec %proto;

Called when you use the Fennec module. %proto is key/value pairs for configuration. Meta data keys should be placed in a hashref under the 'meta' key.

my $obj = $class->new( %proto )

Create a new instance. %proto can be all the same key/value pairs as import(), except that the meta data must be in a hashref under the 'meta' key. You must also specify a 'caller' key with an arrayref containing a package name, filename, and line number for the test file.

Object methods

When you use Fennec, it will create an object internally to do some initialization and exporting. These are it's methods.

test_class()

Returns the test class. This will either be determined by import() or provided to import/new via the first element of the arrayref provided under the 'caller' key.

test_file()

Returns the test filename. This will either be determined by import() or provided to import/new via the second element of the arrayref provided under the 'caller' key.

imported_line()

Returns the line number where fennec was used. This will either be determined by import() or provided to import/new via the third element of the arrayref provided under the 'caller' key.

workflows()

Returns an arrayref containing the workflow names provided at import, or if none were provided, then the defaults will be provided.

asserts()

Returns an arrayref containing the assert names provided at import, or if none were provided, then the defaults will be provided.

root_workflow()

Returns the classname of the root workflow that will be used.

subclass()

Modifies the test classes @ISA array to make it a subclass of Fennec::TestFile

init_meta()

Initializes the meta object for the test class.

export_tools()

Export the basic tools to the test class

export_workflows()

Export the desired workflows to the test class

export_asserts()

Export the desired asserts to the test class

AUTHORS

Chad Granum exodist7@gmail.com

COPYRIGHT

Copyright (C) 2010 Chad Granum

Fennec is free software; Standard perl licence.

Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.