sub does-ok

Documentation for sub does-ok assembled from the following types:

module Test

From Test

(Test) sub does-ok

Defined as:

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

Marks a test as passed if the given $variable can do the given $role. 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