NAME

Test::Pcuke::Gherkin - roll your own cucumber

VERSION

Version 0.000001

SYNOPSIS

This module compiles text in Gherkin to the executable AST. If you don't like Test::Pcuke you can roll your own BDD cucumber-like tool!

use Test::Pcuke::Gherkin;

my $feature = Test::Pcuke::Gherkin->compile($content, $executor);

$feature->execute;
...

METHODS

compile $content, $executor

$content is a text in Gherkin language. It should be decoded string, not octets, especially if the text is written in language other than english

$executor is (optional) object, that has execute() method. If $executor is not provided an internal and useless one is used to execute the steps. See 'ON EXECUTORS' below;

Returns Test::Pcuke::Gherkin::Node::Feature object (feature object)

ON EXECUTORS

Executor that passed to the compile() method is an object whose behaviour depends on your goals. It should have execute() method which accepts Test::Pcuke::Gherkin::Node::Step object so that it can do something with the step. For example:

package Local::MyExecutor;

sub execute {
	my ($self, $step) = @_;
	
	print $step->title;
	
	return 'undef';
}

1;

execute() method is expected to return a status, which can be either a status string or an object. in the latter case the object is expected to have status() method which return a status string.

The meaning of the status string is:

undef, 'undef', 'undefined' ( generally $status_string =~ /undef/ ) The step is undefined
0, q{}, 'fail', 'failure' (generally $status_string =~ /fail/ ) The step execution is failed
1, 'true string', 999, 'pass' (generally $status_string =~ /pass/ ) The step is passed

If no executor is provided a dumb default is used. It says that all steps are undefined and warns on each step that the executor does nothing with the step $step->title.

SEE ALSO

Test::Pcuke cucumber for Perl 5
https://github.com/cucumber/cucumber/wiki/ cucumber Wiki

AUTHOR

"Andrei V. Toutoukine", <"tut at isuct.ru">

BUGS

Please report any bugs or feature requests to bug-test-pcuke-gherkin at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Pcuke-Gherkin. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::Pcuke::Gherkin

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2011 "Andrei V. Toutoukine".

This program is released under the following license: artistic