our $describe_class_query_cache;
sub describe_class_methods {
- my ($class, $requested_mro) = @_;
+ my $args = (
+ ref $_[0] eq 'HASH' ? $_[0]
+ : ( @_ == 1 and ! length ref $_[0] ) ? { class => $_[0] }
+ : { @_ }
+ );
+
+ my ($class, $requested_mro) = @{$args}{qw( class use_mro )};
- croak "Expecting a class name"
+ croak "Expecting a class name either as the sole argument or a 'class' option"
if not defined $class or $class !~ $module_name_rx;
$requested_mro ||= mro::get_mro($class);
is_deeply (
# work around taint, see TODO below
{
- %{describe_class_methods("DBICTest::AttrTest", "dfs")},
+ %{ describe_class_methods({ class => "DBICTest::AttrTest", use_mro => "dfs" }) },
cumulative_gen => $expected_desc->{cumulative_gen},
},
$expected_desc,