-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Example:
use Test::Exception;
use Test::Spec;
sub as (&) { shift; }
describe "what" => as {
context "when" => as {
my $obj;
it 'should pass' => as { pass };
it 'should pass with name' => as { pass "with name" };
it 'should die' => as { throws_ok { $obj->build ({}) } qr/^(?=.*\bbuild\b)/ };
};
};
runtests unless caller;Output:
ok 1 - what when should pass
ok 2 - with name
ok 3 - threw Regexp ((?^:^(?=.*\bbuild\b)))
1..3
Expected output:
ok 1 - what when should pass
ok 2 - what when should pass with name
ok 3 - what when should die
1..3
Better output (mimics Test::More::subtest)
# describe: what
# context: what when
ok 1 - what when should pass
ok 2 - what when should pass with name
ok 3 - what when should die
1..3
ok 1 - what when
1..1
ok 1 - what
1..1
vrcca and piufop
Metadata
Metadata
Assignees
Labels
No labels