Subject: | one-argument call of classes_from_runtime fails |
(before anything else: this is a way cool module. I like it!)
Contrary to what the pod says, calling classes_from_runtime without a
second argument will fail.
I'm attaching a patch that fixes the problem (remove the prototyping
on classes_from_runtime) and add a test on basic.t to verify it.
Subject: | ucs.patch |
diff -r -c UML-Class-Simple-0.04/lib/UML/Class/Simple.pm UML-Class-Simple-yanick/lib/UML/Class/Simple.pm
*** UML-Class-Simple-0.04/lib/UML/Class/Simple.pm Wed Nov 1 00:15:44 2006
--- UML-Class-Simple-yanick/lib/UML/Class/Simple.pm Sat Nov 4 13:07:35 2006
***************
*** 21,27 ****
my $tt = Template->new;
my $dot_template;
! sub classes_from_runtime ($$) {
my ($module, $pattern) = @_;
$pattern = '' if !defined $pattern;
if ($module) {
--- 21,27 ----
my $tt = Template->new;
my $dot_template;
! sub classes_from_runtime {
my ($module, $pattern) = @_;
$pattern = '' if !defined $pattern;
if ($module) {
diff -r -c UML-Class-Simple-0.04/t/basic.t UML-Class-Simple-yanick/t/basic.t
*** UML-Class-Simple-0.04/t/basic.t Tue Oct 31 07:07:32 2006
--- UML-Class-Simple-yanick/t/basic.t Sat Nov 4 13:08:00 2006
***************
*** 1,7 ****
use strict;
use warnings;
! use Test::More tests => 29;
use UML::Class::Simple;
#use Data::Dumper::Simple;
--- 1,7 ----
use strict;
use warnings;
! use Test::More tests => 30;
use UML::Class::Simple;
#use Data::Dumper::Simple;
***************
*** 9,14 ****
--- 9,17 ----
my (@classes, $painter);
+ @classes = classes_from_runtime( 'PPI' );
+ ok @classes, 'calling classes_from_runtime with one argument';
+
@classes = classes_from_runtime("PPI", qr/^PPI::/);
ok @classes > 5, 'a lot of PPI classes found';