From 3dee1a063a002342238dc408e687f6f3bf1fdbcd Mon Sep 17 00:00:00 2001 From: Kang-min Liu Date: Thu, 4 Jun 2009 15:03:12 +0800 Subject: [PATCH] Checking in changes prior to tagging of version 0.02. Changelog diff is: 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. - --- Changes | 5 ++++- lib/Test/Cukes.pm | 35 ++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 14 deletions(-) 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. - diff --git a/lib/Test/Cukes.pm b/lib/Test/Cukes.pm index e097ebd..bc64fc1 100644 --- a/lib/Test/Cukes.pm +++ b/lib/Test/Cukes.pm @@ -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 @@ -128,9 +124,20 @@ family of C modules. It uses L 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 function, defines your step handlers, and then run all the -tests by calling C. +uses it in the test programs, feed the feature text into C +function, defines your step handlers, and then run all the tests by +calling C. Each steps should use C instead of C +or C to verify desired result. + +If any assertion in the Given block failed, the the corresponding +C and C blocks are skipped. + +You don't need to specify the number of tests with C. 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 function from C for you +to use in the step block. For more info about how to define feature and scenarios, please read the documents from L. @@ -146,6 +153,8 @@ The official Cucumber web-page, L. cucumber.pl, L, another Perl implementation of Cucumber tool. +L + =head1 LICENSE AND COPYRIGHT Copyright (c) 2009, Kang-min Liu C<< >>.