[Moose-commits] r7578 - in Class-MOP/trunk/t: . lib
lib/TestClassLoaded
autarch at code2.0beta.co.uk
autarch at code2.0beta.co.uk
Sun Feb 8 15:07:54 GMT 2009
Author: autarch
Date: 2009-02-08 07:07:54 -0800 (Sun, 08 Feb 2009)
New Revision: 7578
Added:
Class-MOP/trunk/t/lib/TestClassLoaded/
Class-MOP/trunk/t/lib/TestClassLoaded/Sub.pm
Class-MOP/trunk/t/lib/TestClassLoaded2.pm
Class-MOP/trunk/t/lib/TestClassLoaded3.pm
Modified:
Class-MOP/trunk/t/083_load_class.t
Log:
add a bunch of tests for is_class_loaded
Modified: Class-MOP/trunk/t/083_load_class.t
===================================================================
--- Class-MOP/trunk/t/083_load_class.t 2009-02-08 14:53:48 UTC (rev 7577)
+++ Class-MOP/trunk/t/083_load_class.t 2009-02-08 15:07:54 UTC (rev 7578)
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 29;
+use Test::More tests => 33;
use Test::Exception;
require Class::MOP;
@@ -91,3 +91,26 @@
'the mere mention of TestClassLoaded in the whatever sub does not make us think it has been loaded' );
}
+{
+ require TestClassLoaded::Sub;
+ ok( ! Class::MOP::is_class_loaded('TestClassLoaded'),
+ 'requiring TestClassLoaded::Sub does not make us think TestClassLoaded is loaded' );
+}
+
+{
+ require TestClassLoaded;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded'),
+ 'We see that TestClassLoaded is loaded after requiring it (it has methods but no $VERSION or @ISA)' );
+}
+
+{
+ require TestClassLoaded2;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded2'),
+ 'We see that TestClassLoaded2 is loaded after requiring it (it has a $VERSION but no methods or @ISA)' );
+}
+
+{
+ require TestClassLoaded3;
+ ok( Class::MOP::is_class_loaded('TestClassLoaded3'),
+ 'We see that TestClassLoaded3 is loaded after requiring it (it has an @ISA but no methods or $VERSION)' );
+}
Added: Class-MOP/trunk/t/lib/TestClassLoaded/Sub.pm
===================================================================
--- Class-MOP/trunk/t/lib/TestClassLoaded/Sub.pm (rev 0)
+++ Class-MOP/trunk/t/lib/TestClassLoaded/Sub.pm 2009-02-08 15:07:54 UTC (rev 7578)
@@ -0,0 +1,7 @@
+package TestClassLoaded::Sub;
+use strict;
+use warnings;
+
+sub ver_test { return "TestClassLoaded ver $TestClassLoaded::VERSION" }
+
+1;
Property changes on: Class-MOP/trunk/t/lib/TestClassLoaded/Sub.pm
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Rev
Name: svn:eol-style
+ native
Added: Class-MOP/trunk/t/lib/TestClassLoaded2.pm
===================================================================
--- Class-MOP/trunk/t/lib/TestClassLoaded2.pm (rev 0)
+++ Class-MOP/trunk/t/lib/TestClassLoaded2.pm 2009-02-08 15:07:54 UTC (rev 7578)
@@ -0,0 +1,8 @@
+package TestClassLoaded2;
+use strict;
+use warnings;
+
+our $VERSION = 42;
+
+1;
+
Property changes on: Class-MOP/trunk/t/lib/TestClassLoaded2.pm
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Rev
Name: svn:eol-style
+ native
Added: Class-MOP/trunk/t/lib/TestClassLoaded3.pm
===================================================================
--- Class-MOP/trunk/t/lib/TestClassLoaded3.pm (rev 0)
+++ Class-MOP/trunk/t/lib/TestClassLoaded3.pm 2009-02-08 15:07:54 UTC (rev 7578)
@@ -0,0 +1,8 @@
+package TestClassLoaded3;
+use strict;
+use warnings;
+
+our @ISA = 'Foo';
+
+1;
+
Property changes on: Class-MOP/trunk/t/lib/TestClassLoaded3.pm
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Rev
Name: svn:eol-style
+ native
More information about the Moose-commits
mailing list