Code-Style-Kit

 view release on metacpan or  search on metacpan

t/tests/kits.t  view on Meta::CPAN

        or diag $exception;
    ok($pkgname->can('thing'),'and import the correct module');
    is($pkgname->thing,'thing','and the method should work');
};

subtest 'introspection and conditionals' => sub {
    my ($ok, $exception, $pkgname) = compile('two','');
    ok($ok,'importing other features, and maybe-importing a non-existent one, should compile')
        or diag $exception;
    ok($pkgname->can('two'),'the requested feature should be imported');
    ok($pkgname->can('one'),'the cascaded feature should be imported');
    ok($pkgname->can('args'),'the optional cascaded feature should be imported');
    is($pkgname->two,2,'the requested feature should work');
    is($pkgname->one,1,'the cascaded feature should work');
    is($pkgname->args,[4,5,6],'the optional cascaded feature should get the arguments');

    ($ok, $exception, $pkgname) = compile('qw(two not_two)','');
    ok(!$ok,'importing confilcting features should die');
    like($exception,qr{\bnot two\b},'and the exception should bubble up');
};

done_testing;



( run in 0.683 second using v1.01-cache-2.11-cpan-49f99fa48dc )