X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fextra%2Finternals%2Fattributes.t;fp=xt%2Fextra%2Finternals%2Fattributes.t;h=6567ec6bcbde56feafc8c306857253206b5ae371;hb=c47451b7bcac767f6c3a7d9e348991a40b196f1a;hp=1f9d7b58b72fc631061e3c72563fa129a84d1cd0;hpb=12a184d0a0c1868708e43aaabefe08f9e7ac9ec4;p=dbsrgits%2FDBIx-Class.git diff --git a/xt/extra/internals/attributes.t b/xt/extra/internals/attributes.t index 1f9d7b5..6567ec6 100644 --- a/xt/extra/internals/attributes.t +++ b/xt/extra/internals/attributes.t @@ -35,6 +35,7 @@ my $pkg_gen_history = {}; { package UEBERVERSAL; sub ueber {} } @UNIVERSAL::ISA = "UEBERVERSAL"; +sub UNIVERSAL::uni { "unistuff" } sub grab_pkg_gen ($) { push @{ $pkg_gen_history->{$_[0]} }, [ @@ -379,6 +380,13 @@ sub add_more_attrs { via_class => "UEBERVERSAL", } ], + uni => [ + { + attributes => {}, + name => "uni", + via_class => "UNIVERSAL", + } + ], can => [ { attributes => {}, @@ -479,6 +487,27 @@ sub add_more_attrs { $expected_desc, 'describing with implicit mro returns correct data' ); + + # check that a UNIVERSAL-parent interrogation makes sense + # ( it should not list anything from UNIVERSAL itself ) + is_deeply ( + describe_class_methods("UEBERVERSAL"), + { + # should be cached by now, thus safe to rely on...? + cumulative_gen => DBIx::Class::_Util::get_real_pkg_gen('UEBERVERSAL'), + + class => 'UEBERVERSAL', + mro => { is_c3 => 0, type => 'dfs' }, + isa => [], + methods => { + ueber => $expected_desc->{methods}{ueber} + }, + methods_defined_in_class => { + ueber => $expected_desc->{methods}{ueber}[0] + }, + }, + "Expected description of a parent-of-UNIVERSAL class (pathological case)", + ); } if ($skip_threads) {