Venus::Role::Testable

Testable Role

Testable Role for Perl 5

method: is_false method: is_true

package Example;

use Venus::Class;

with 'Venus::Role::Testable';

attr 'value';

sub execute {
  return pop;
}

package main;

my $example = Example->new;

# $example->is_true(sub{0});

This package modifies the consuming package and provides methods for dispatching method calls and returning truthy returns as true and falsy returns as false boolean values.

The is_false method dispatches the method call or executes the callback and returns truthy as false and falsy returns as true "boolean" values.

is_false(string | coderef $method, any @args) (boolean)

{ since => '0.08', }

=example-1 is_false

package main;

my $example = Example->new;

my $true = $example->is_false(execute => 0);

# 1

The is_true method dispatches the method call or executes the callback and returns truthy returns as true and falsy returns as false "boolean" values.

is_true(string | coderef $method, any @args) (boolean)

{ since => '0.08', }

=example-1 is_true

package main;

my $example = Example->new;

my $true = $example->is_true(execute => 1);

# 1

t/Venus.t: present: authors t/Venus.t: present: license

17 POD Errors

The following errors were encountered while parsing the POD:

Around line 14:

Unknown directive: =name

Around line 22:

Unknown directive: =tagline

Around line 30:

Unknown directive: =abstract

Around line 38:

Unknown directive: =includes

Around line 47:

Unknown directive: =synopsis

Around line 78:

Unknown directive: =description

Around line 88:

Unknown directive: =method

Around line 94:

Unknown directive: =signature

Around line 98:

Unknown directive: =metadata

Around line 134:

=cut found outside a pod block. Skipping to next block.

Around line 154:

=cut found outside a pod block. Skipping to next block.

Around line 164:

Unknown directive: =method

Around line 170:

Unknown directive: =signature

Around line 174:

Unknown directive: =metadata

Around line 210:

=cut found outside a pod block. Skipping to next block.

Around line 230:

=cut found outside a pod block. Skipping to next block.

Around line 240:

Unknown directive: =partials