From: Yuval Kogman Date: Tue, 17 Jun 2008 04:26:44 +0000 (+0000) Subject: Be nice to Moose::Role::unimport in older moose X-Git-Tag: 0.19~289 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ddd4992c86d379ec9b013bdbb6e070d939ee18f0;p=gitmo%2FMouse.git Be nice to Moose::Role::unimport in older moose --- diff --git a/lib/Squirrel/Role.pm b/lib/Squirrel/Role.pm index dfcb2e5..ca41eef 100644 --- a/lib/Squirrel/Role.pm +++ b/lib/Squirrel/Role.pm @@ -9,7 +9,7 @@ sub _choose_backend { if ( $INC{"Moose/Role.pm"} ) { return { import => \&Moose::Role::import, - unimport => \&Moose::Role::unimport, + unimport => defined &Moose::Role::unimport ? \&Moose::Role::unimport : sub {}, } } else { require Mouse::Role; diff --git a/t/202-squirrel-role.t b/t/202-squirrel-role.t index 807ccbb..5c70361 100644 --- a/t/202-squirrel-role.t +++ b/t/202-squirrel-role.t @@ -39,7 +39,10 @@ do { }; ok(!Foo::Role->can('has'), "Mouse::Role::has was unimported"); -ok(!Bar::Role->can('has'), "Moose::Role::has was unimported"); +SKIP: { + skip "ancient moose", 1 if $Moose::VERSION <= 0.50; + ok(!Bar::Role->can('has'), "Moose::Role::has was unimported"); +} eval " package Foo::Role;