1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
use strict;
use warnings;
use Test::More;
{
package Local::Dummy;
use Test::Requires 'Moo';
use Test::Requires 'MooX::ProtectedAttributes';
use Test::Requires 'MooX::Should';
use Test::Requires 'Types::Standard';
};
{
package Local::TestClass;
use Moo;
use MooX::Should;
use Sub::HandlesVia;
use MooX::ProtectedAttributes;
use Types::Standard 'Bool';
protected_has _client_halted => (
is => 'rw',
should => Bool,
reader => '_has_client_halted',
default => 0,
handles_via => 'Bool',
handles => {
_halt_client => 'set',
},
);
}
my $client = Local::TestClass->new();
$client->_halt_client();
ok( $client->{_client_halted} );
done_testing;
|