[Bps-public-commit] r14882 - in Class-Require/trunk: lib/Class t
sartak at bestpractical.com
sartak at bestpractical.com
Wed Aug 6 20:18:48 EDT 2008
Author: sartak
Date: Wed Aug 6 20:18:47 2008
New Revision: 14882
Modified:
Class-Require/trunk/ (props changed)
Class-Require/trunk/lib/Class/Require.pm
Class-Require/trunk/t/001-is-class-loaded.t
Log:
r68915 at onn: sartak | 2008-08-06 20:18:05 -0400
$VERSION's cool too
Modified: Class-Require/trunk/lib/Class/Require.pm
==============================================================================
--- Class-Require/trunk/lib/Class/Require.pm (original)
+++ Class-Require/trunk/lib/Class/Require.pm Wed Aug 6 20:18:47 2008
@@ -35,6 +35,9 @@
# ..such as @ISA?
return 1 if exists $table->{ISA};
+ # ..such as $VERSION?
+ return 1 if exists $table->{VERSION};
+
return 0;
}
Modified: Class-Require/trunk/t/001-is-class-loaded.t
==============================================================================
--- Class-Require/trunk/t/001-is-class-loaded.t (original)
+++ Class-Require/trunk/t/001-is-class-loaded.t Wed Aug 6 20:18:47 2008
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 6;
use Class::Require 'is_class_loaded';
@@ -20,3 +20,15 @@
};
ok(is_class_loaded('Class::Require::WithMethodISA'), "class that defines a method ISA is loaded (no point in requiring it to be \@ISA)");
+do {
+ package Class::Require::WithVERSION;
+ our $VERSION = '1.0';
+};
+ok(is_class_loaded('Class::Require::WithVERSION'), "class that defines \$VERSION is loaded");
+
+do {
+ package Class::Require::WithMethodVERSION;
+ sub VERSION { '1.0' }
+};
+ok(is_class_loaded('Class::Require::WithMethodVERSION'), "class that defines a method VERSION is loaded (no point in requiring it to be \$VERSION)");
+
More information about the Bps-public-commit
mailing list