NAME

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

VERSION

Version 0.02

SYNOPSIS

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

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

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

None.

SEE ALSO

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

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

AUTHOR

MIZUTANI Tociyuki <tociyuki@gmail.com>

LICENCE AND COPYRIGHT

Copyright (c) 2009, MIZUTANI Tociyuki <tociyuki@gmail.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.