Suite

NAME

Test::Declare::Suite

SYNOPSIS

use Test::Declare::Suite;
    use Module::Under::Test;
class MyTest does Test::Declare::Suite {
        method class { Module::Under::Test }
        method method { 'some-method' }
        method construct { \(some => 'value') }
method tests {
            ${
                name => 'test 1',
                args => \(3),
                expected => {
                    return-value => …,
                },
            },
            …
        }
    }
MyTest.new.run-me;

Test::Declare::Suite is a helper role which enables bundling of multiple tests that operate on the same callable, to reduce repetition.

When consuming the role, you must implement methods called class, method and construct (if appropriate) to use as defaults. Also implement method tests() returns Array {...} for the slimmed down test scenarios, now varying only on arguments and expectations.

Individual test hashes can still provide any element of the call hash to override the default.

Each class's tests should be executed by calling ClassName.new.run-me.

Test::Declare v0.0.3

Declare common test scenarios as data.

Authors

  • Darren Foreman

License

Artistic-2.0

Dependencies

IO::Capture::Simple

Test Dependencies

Provides

  • Test::Declare
  • Test::Declare::Callable
  • Test::Declare::Comparisons
  • Test::Declare::Expectations
  • Test::Declare::Result
  • Test::Declare::Suite

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.