File: feature.t

package info (click to toggle)
libtest-cukes-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 200 kB
  • ctags: 155
  • sloc: perl: 1,959; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env perl -w
use strict;
use Test::More qw(no_plan);

use Test::Cukes::Feature;

my $feature = Test::Cukes::Feature->new(<<TEXT);
Feature: Hendrerit iriure et dolore autem tincidunt enim autem
  In order to Quis facilisis facilisis minim esse
  As a dolor te duis.
  I want to vel feugait vulputate molestie.

  Scenario: Some random scenario text
    Given the pre-conditions is there
    When it branches into the second level
    Then the final shall be reached
TEXT

is($feature->name, "Hendrerit iriure et dolore autem tincidunt enim autem");
like($feature->body, qr/In order to.+As.+I want/s);
is(scalar @{ $feature->scenarios }, 1);

my $scenario = $feature->scenarios->[0];
is($scenario->name, "Some random scenario text");
is_deeply($scenario->steps, ["Given the pre-conditions is there",
                             "When it branches into the second level",
                             "Then the final shall be reached"]);