forked from gugod/Test-Cukes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let runtests function accept feature text as args.
- Loading branch information
Showing
3 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env perl -w | ||
use strict; | ||
use Test::Cukes; | ||
my @passed; | ||
|
||
Given qr/blah1/ => sub { | ||
push @passed, 1; | ||
|
||
assert @passed == 1; | ||
}; | ||
|
||
When qr/blah2/ => sub { | ||
push @passed, 2; | ||
assert @passed == 2; | ||
}; | ||
|
||
Then qr/blah3/ => sub { | ||
push @passed, 3; | ||
assert @passed == 3; | ||
|
||
assert( @{[ 1, 2, 3 ]} == @passed ); | ||
}; | ||
|
||
runtests(<<FEATURE_TEXT); | ||
Feature: foo | ||
In order to bleh | ||
I want to bleh | ||
Scenario: blehbleh | ||
Given blah1 | ||
When blah2 | ||
Then blah3 | ||
FEATURE_TEXT |