~ubuntu-branches/ubuntu/precise/libtest-cukes-perl/precise

« back to all changes in this revision

Viewing changes to examples/test.pl

  • Committer: Bazaar Package Importer
  • Author(s): Christine Spang
  • Date: 2009-08-29 22:42:34 UTC
  • Revision ID: james.westby@ubuntu.com-20090829224234-68xovx8aw72s0kd4
Tags: upstream-0.08
ImportĀ upstreamĀ versionĀ 0.08

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env perl
 
2
use strict;
 
3
use warnings;
 
4
 
 
5
# test.pl
 
6
use Test::More;
 
7
use Test::Cukes;
 
8
 
 
9
feature(<<TEXT);
 
10
Feature: writing behavior tests
 
11
  In order to make me happy
 
12
  As a test maniac
 
13
  I want to write behavior tests
 
14
 
 
15
  Scenario: Hello World
 
16
    Given the test program is running
 
17
    When it reaches this step
 
18
    Then it should pass
 
19
TEXT
 
20
 
 
21
Given qr/the test program is running/, sub {
 
22
    pass("running");
 
23
};
 
24
 
 
25
When qr/it reaches this step/, sub {
 
26
    pass("reaches");
 
27
};
 
28
 
 
29
Then qr/it should pass/, sub {
 
30
    pass("passes");
 
31
};
 
32
 
 
33
plan tests => 3;
 
34
runtests;