does-ok
ErrorsCollection

does-ok

Synthesised documentation from type/Test

From type/Test

See Original text in context

multi sub does-ok(Mu $varMu $type$desc = "...")

Marks a test as passed if the given $var can do the given role $type. The function accepts an optional description of the test.

# create a Womble who can invent 
role Invent {
    method brainstorm { say "Aha!" }
}
class Womble {}
class Tobermory is Womble does Invent {}
 
# ... and later in the tests 
use Test;
 
my $tobermory = Tobermory.new;
 
# with automatically generated test description 
does-ok $tobermoryInvent;
#  => The object does role Type 
 
does-ok $tobermoryInvent"Tobermory can invent";
#  => Tobermory can invent