Test::Class::SugarHelper syntax for writing Test::Class tests | |
Download |
Test::Class::Sugar Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Piers Cawley
- Publisher web site:
- http://search.cpan.org/~pdcawley/
Test::Class::Sugar Tags
Test::Class::Sugar Description
Helper syntax for writing Test::Class tests Test::Class::Sugar is a Perl module that provides a new syntax for setting up your Test::Class based tests. The idea is that we bundle up all the tedious boilerplate involved in writing a class in favour of getting to the meat of what you're testing. We made warranted assumptions about what you want to do, and we do them for you. So, when you write testclass exercises Person { ... }What Perl sees, after Test::Class::Sugar has done its work, is roughly: { package Test::Person; use base qw/Test::Class/; use strict; use warnings; require Person; sub subject { 'Person' }; ... }Some of the assumptions we made are overrideable, others aren't. Yet. Most of them will be though.SYNOPSIS use Test::Class::Sugar; testclass exercises Person { # Test::Most has been magically included startup >> 1 { use_ok $test->subject; } test autonaming { is ref($test), 'Test::Person'; } test the naming of parts { is $test->current_method, 'test_the_naming_of_parts'; } test multiple assertions >> 2 { is ref($test), 'Test::Person'; is $test->current_method, 'test_multiple_assertions'; } } Test::Class->runtests; Requirements: · Perl
Test::Class::Sugar Related Software