public
Description: Add Devel::Declare sugar to Test::Class
Homepage:
Clone URL: git://github.com/pdcawley/test-class-sugar.git
pdcawley (author)
Fri Apr 03 23:15:10 -0700 2009
commit  cdbc7ef17a349536089a3937d4bc694941c9bd4f
tree    5a25d8dcd88deb02be0f007447c402e0b014e489
parent  f32851fd3c2777934dc88750eb43f4116dd363e7
name age message
file .gitignore Wed Mar 11 04:29:30 -0700 2009 Initial import of very crappy library [pdcawley]
file LICENSE Fri Mar 13 23:32:10 -0700 2009 Started adding module paraphenalia [pdcawley]
file Makefile.PL Wed Apr 01 12:22:31 -0700 2009 Prepping for CPAN release [pdcawley]
file README.textile Sat Mar 28 09:32:28 -0700 2009 Test::Class no longer needs patching. Thanks to... [pdcawley]
file TODO.pod Wed Apr 01 23:58:31 -0700 2009 Added a TODO.pod for missing features, outstand... [pdcawley]
directory lib/ Loading commit data...
directory t/
README.textile

Test::Class::Sugar

Synopsis

Test::Class::Sugar is a declarative wrapper around Adrian Howard’s
Test::Class xUnit style Perl
testing library.

The idea is that, instead of writing:


package Test::Something;
use base qw/Test::Class/;

use Test::Most;

sub subject {
  'Something'
}

sub test_something : Test(3) {
  my $test = shift;
  is $test->current_method, 'test_something';
  is $test->subject, 'Something';
  isa_ok $test, 'Test::Something';
}

You will be able to write:


use Test::Class::Sugar;

testclass exercises Something {
  test something >> 3 {
    is $test->current_method, 'test_something';
    is $test->subject, 'Something';
    isa_ok $test, 'Test::Something';
  }
}

Prerequisites

There will be a proper list of library prerequisites in Makefile.PL by the
time this gets properly released, but at the time of writing there are a
couple of requirements that can’t be fulfilled from CPAN.

You’ll need a bleeding edge
Devel::Declare from Github