Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Add Devel::Declare sugar to Test::Class
Perl
Branch: master
Failed to load latest commit information.
lib/Test/Class Added thanks to NET-A-PORTER for sponsoring Joel's work
t I feel slightly dirty. Got rid of Modern::Perl from the dependencies
.gitignore Initial import of very crappy library
LICENSE Started adding module paraphenalia
Makefile.PL remove uses of defined-or operator, permits T::C::Sugar to run on 5.8.x
README.textile Tweaked README.textile to reflect the fact that we work with CPAN stu…
TODO.pod

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';
  }
}
Something went wrong with that request. Please try again.