use strictures 1;
use Test::More;
+use Test::Fatal;
use lib "t/lib";
is $bar->foobot, 'beep', 'asserter checks for existence not truth, on false value';
is $bar->foobar, 'bar', 'asserter checks for existence not truth, on undef ';
+
+ok(my $e = exception {
+ package Baz;
+ use Moo;
+ has foo => ( is => 'ro', handles => 'Robot' );
+ sub smash { 1 };
+}, 'handles will not overwrite locally defined method');
+like $e, qr{You cannot overwrite a locally defined method \(smash\) with a delegation},
+ '... and has correct error message';
+
+ok(exception {
+ package Fuzz;
+ use Moo;
+ has foo => ( is => 'ro', handles => $bar );
+}, 'invalid handles throws exception');
+
done_testing;