#!/usr/bin/perl { package ConsumerOf::MyRole; use Moo; with 'MyRole'; } use Test::Spec; use Test::Exception; describe MyRole => sub { my $o; before each => sub { $o = 'ConsumerOf::MyRole'->new; }; it 'knows the foo method' => sub { lives_ok { $o->foo }; }; it 'foos truth' => sub { is $o->foo(1), 'true'; }; it 'foos false' => sub { is $o->foo(0), 'false'; }; }; runtests();