Skip to content

Commit

Permalink
Checking in changes prior to tagging of version 0.02. Changelog diff is:
Browse files Browse the repository at this point in the history
diff --git a/Changes b/Changes
index 55197b2..d86e995 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 Revision history for Perl extension Test::Cukes

+0.02:
+- Count each block as one assertion-based test
+- If pre-condition steps fail, then its successing steps will be skipped.
+
 0.01:
 - initial version
 - basic implementation.
-
  • Loading branch information
gugod committed Jun 4, 2009
1 parent 9cf213a commit 3dee1a0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
5 changes: 4 additions & 1 deletion Changes
@@ -1,6 +1,9 @@
Revision history for Perl extension Test::Cukes

0.02:
- Count each block as one assertion-based test
- If pre-condition steps fail, then its successing steps will be skipped.

0.01:
- initial version
- basic implementation.

35 changes: 22 additions & 13 deletions lib/Test/Cukes.pm
Expand Up @@ -94,30 +94,26 @@ Write your test program like this:
TEXT
Given qr/the test program is running/, sub {
pass("running");
assert "running";
}
When qr/it reaches this step/, sub {
pass("reaches");
assert "reaches";
}
Then qr/it should pass/, sub {
pass("passes");
assert "passes";
}
plan tests => 3;
runtests;
When it runs, it looks like this:
> perl test.pl
1..3
# Given the test program is running
ok 1 - running
# When it reaches this step
ok 2 - reaches
# Then it should pass
ok 3 - passes
ok 1 - Given the test program is running
ok 2 - When it reaches this step
ok 3 - Then it should pass
=head1 DESCRIPTION
Expand All @@ -128,9 +124,20 @@ family of C<Test::*> modules. It uses L<Test::More::note> function
internally to print messages.
This module implements the Given-When-Then clause only in English. To
uses it in the test programs, you feed your feature text into
C<feature> function, defines your step handlers, and then run all the
tests by calling C<runtests>.
uses it in the test programs, feed the feature text into C<feature>
function, defines your step handlers, and then run all the tests by
calling C<runtests>. Each steps should use C<assert> instead of C<ok>
or C<is> to verify desired result.
If any assertion in the Given block failed, the the corresponding
C<When> and C<Then> blocks are skipped.
You don't need to specify the number of tests with C<plan>. Each step
block itself is simply one test. If the block died, it's then
considered failed. Otherwise it's considered as passing.
Test::Cukes re-exports C<assert> function from C<Carp::Assert> for you
to use in the step block.
For more info about how to define feature and scenarios, please read
the documents from L<http://cukes.info>.
Expand All @@ -146,6 +153,8 @@ The official Cucumber web-page, L<http://cukes.info/>.
cucumber.pl, L<http://search.cpan.org/dist/cucumber/>, another Perl
implementation of Cucumber tool.
L<Carp::Assert>
=head1 LICENSE AND COPYRIGHT
Copyright (c) 2009, Kang-min Liu C<< <gugod@gugod.org> >>.
Expand Down

0 comments on commit 3dee1a0

Please sign in to comment.