Created
January 22, 2015 12:35
-
-
Save andyjones/343b88e0b57079525222 to your computer and use it in GitHub Desktop.
Minimal test case for https://rt.cpan.org/Public/Bug/Display.html?id=89249
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Test::More; | |
use Test::Fatal; | |
use Class::MOP; | |
use Class::MOP::Class; | |
{ | |
package Foo; | |
use constant FOO_CONSTANT => 'Foo-CONSTANT'; | |
} | |
my $Foo = Class::MOP::Class->initialize('Foo'); | |
ok( $Foo->has_method('FOO_CONSTANT'), | |
'This succeeds when it is called before adding the bork method' ); | |
my $bork_blessed = bless sub { }, 'Non::Meta::Class'; | |
$Foo->add_method('bork', $bork_blessed); | |
ok( $Foo->has_method('FOO_CONSTANT'), | |
q{... this fails with the error message Can't locate object method "body" via package "Non::Meta::Class"} ); | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment