1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
package Test::BDD::Cucumber::Manual::Integration;
$Test::BDD::Cucumber::Manual::Integration::VERSION = '0.26';
=head1 NAME
Test::BDD::Cucumber::Manual::Integration - Integrating with Test::Builder
=head1 VERSION
version 0.26
=head1 DESCRIPTION
How to use Test::BDD::Cucumber in your test suite
=head1 OVERVIEW
You may well want your Cucumber tests to be executed as part of your standard
test-suite. Luckily, this is SUPER easy.
=head1 WELL-COMMENTED EXAMPLE
#!perl
use strict;
use warnings;
use FindBin::libs;
# This will find step definitions and feature files in the directory you point
# it at below
use Test::BDD::Cucumber::Loader;
# This harness prints out nice TAP
use Test::BDD::Cucumber::Harness::TestBuilder;
# Load a directory with Cucumber files in it. It will recursively execute any
# file matching .*_steps.pl as a Step file, and .*\.feature as a feature file.
# The features are returned in @features, and the executor is created with the
# step definitions loaded.
my ( $executor, @features ) = Test::BDD::Cucumber::Loader->load(
't/cucumber_core_features/' );
# Create a Harness to execute against. TestBuilder harness prints TAP
my $harness = Test::BDD::Cucumber::Harness::TestBuilder->new({});
# For each feature found, execute it, using the Harness to print results
$executor->execute( $_, $harness ) for @features;
done_testing;
=cut
1;
|