From: Marc Mims Date: Tue, 26 May 2009 18:24:55 +0000 (-0700) Subject: Test around 'isa' X-Git-Tag: 0.80~63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6dabb7f53858fea0ca54502917a23cae5b5a5646;p=gitmo%2FMoose.git Test around 'isa' --- diff --git a/t/010_basics/018_universal_methods.t b/t/010_basics/018_universal_methods.t index 023fa58..70a89eb 100644 --- a/t/010_basics/018_universal_methods.t +++ b/t/010_basics/018_universal_methods.t @@ -1,24 +1,32 @@ #!perl +# UNIVERSAL methods should be wrappable + use strict; use warnings; + +{ + package FakeBar; + use Moose::Role; -use Test::More; + around isa => sub { + my ($orig, $self, $v) = @_; + return 1 if $v eq 'Bar'; + return $orig->($self, $v); + }; -{ package Foo; use Moose; -} + + use Test::Exception; + use Test::More tests => 2; + TODO: { + local $TODO = 'UNIVERSAL methods should be wrappable'; -plan tests => scalar ( my @universal_methods = qw/isa can VERSION/ ); + lives_ok { with 'FakeBar' } 'applied role'; -my $foo = Foo->new; - -TODO: { - local $TODO = 'UNIVERSAL methods should be available'; - - for my $method ( @universal_methods ) { - ok $foo->meta->find_method_by_name($method), "has UNIVERSAL method $method"; - } -}; + my $foo = Foo->new; + isa_ok $foo, 'Bar'; + }; +}