summaryrefslogtreecommitdiff
path: root/t/bugs/delete_sub_stash.t
blob: ce3f9683919a269f79a8cf3f161e8f4a1d2bc8aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use strict;
use warnings;
use Test::More;

use Moose ();

{
    package Foo;
    sub bar { 'BAR' }
}

my $method = \&Foo::bar;

{
    no strict 'refs';
    delete ${'::'}{'Foo::'};
}

my $meta = Moose::Meta::Class->create('Bar');
$meta->add_method(bar => $method);
is(Bar->bar, 'BAR');

done_testing;