File: modify_lazy_handlers.t

package info (click to toggle)
libmoo-perl 0.091011-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 476 kB
  • sloc: perl: 1,688; makefile: 4; sh: 1
file content (23 lines) | stat: -rw-r--r-- 378 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strictures 1;
use Test::More;
use lib qw(t/lib);

use_ok 'MooObjectWithDelegate';

{
    package MooObjectWithDelegate;
    use Moo;

    around 'connect', sub {
      my ($orig, $self, @args) = @_;
      return $self->$orig(@args) . 'c';
    };
}

ok my $moo_object = MooObjectWithDelegate->new,
  'got object';

is $moo_object->connect, 'abc',
  'got abc';

done_testing;