summaryrefslogtreecommitdiffstats
path: root/t/extending/method.t
blob: 8599720c640efbafd6f5e8febec371f8bcad7e65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Output;
use lib 't/lib';

{
    package Foo;
    use Moose;
    use AtomicMethod;

    atomic_method foo => sub {
        warn "in foo\n";
    };
}

my $foo = Foo->new;
stderr_is(sub { $foo->foo }, "locking...\nin foo\nunlocking...\n");

done_testing;