Test::Behaviour::Spec - Interiors of tests for the Behaviour Driven Developments.


Test-Behaviour-Spec documentation  | view source Contained in the Test-Behaviour-Spec distribution.

Index


NAME

Top

Test::Behaviour::Spec - Interiors of tests for the Behaviour Driven Developments.

VERSION

Top

Version 0.02

SYNOPSIS

Top

    use Test::Behaviour::Spec;
    use Test::More tests => 5;

    BEGIN { use_ok('Counter') }

    {
        describe 'Counter';

        it 'should create an instance.';
            ok ref(Counter->new), spec;
    }

    {
        describe '$counter, when counting up,';
            my $counter = Counter->new;

        it 'should has a initial value zero.';
            is $counter->value, 0, spec;
            my $v = $counter->value;

        it 'should count up.';
            ok $counter->can('up'), spec;
            $counter->up;

        it 'should return a succeed value from the initial one.';
            is $counter->value, $v + 1, spec;
    }

DESCRIPTION

Top

Let's play believe that we are the Behaviour Driven Developers, putting some additional interiors in our tests. This module provides you such interiors of three subroutines: 'describe', 'it', and 'spec'. The naming of them are based on the RSpec that is a Behaviour Driven Development (BDD) framework for the ruby programing language.

SUBROUTINES

Top

describe "SUBJECT, when SITUATON,"

The subroutine 'describe' calls a name of a subject with a situation.

it "should behave ..."

The subroutine 'it' becomes a subject in the behaviour statement.

spec

The subroutine 'spec' builds a test name as a statement string with a subject at last describe subroutine and a statement at the last it subroutine.

DEPENDENCIES

Top

None.

SEE ALSO

Top

Test::More::Behaviours is gives you behaviours in a code reference.

http://rspec.info/ is the original Behaviour Driven Development framework for Ruby.

AUTHOR

Top

MIZUTANI Tociyuki <tociyuki@gmail.com>

LICENCE AND COPYRIGHT

Top


Test-Behaviour-Spec documentation  | view source Contained in the Test-Behaviour-Spec distribution.