X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F06_user.t;h=62db2663ea0dee52a02e8cd639d871d20ab130e6;hb=63c4ccef9296008abafa15d5f5822d817762dd69;hp=f2bfa8ce01eb4ecce0f7d09b732c969243c61ae6;hpb=5c5af3452cf4b03d7d55e20870942f1b600081b7;p=catagits%2FCatalyst-Plugin-Authentication.git diff --git a/t/06_user.t b/t/06_user.t index f2bfa8c..62db266 100644 --- a/t/06_user.t +++ b/t/06_user.t @@ -1,26 +1,34 @@ use strict; use warnings; -use Test::More tests => 6; +use Test::More; use Test::Exception; my $m; BEGIN { use_ok($m = "Catalyst::Authentication::User") } { - package SomeUser; - use base $m; - - sub new { bless {}, shift }; - - sub supported_features { - { - feature => { - subfeature => 1, - unsupported_subfeature => 0, - }, - top_level => 1, - } - } + package SomeBaseUser; + sub other_method { 'FNAR' }; +} + +{ + package SomeUser; + use base $m; + + sub new { bless {}, shift }; + + sub supported_features { + { + feature => { + subfeature => 1, + unsupported_subfeature => 0, + }, + top_level => 1, + } + } + sub get_object { + bless {}, 'SomeBaseUser'; + } } my $o = SomeUser->new; @@ -32,11 +40,17 @@ ok( $o->supports(qw/feature subfeature/), "traversal"); ok( !$o->supports(qw/feature unsupported_subfeature/), "traversal terminating in false"); lives_ok { - $o->supports("bad_key"); + $o->supports("bad_key"); } "can check for non existent feature"; #dies_ok { -# $o->supports(qw/bad_key subfeature/) +# $o->supports(qw/bad_key subfeature/) #} "but can't traverse into one"; +lives_ok { + is $o->other_method, 'FNAR', 'Delegation onto user object works'; +} 'Delegation lives'; + +done_testing; +