[Bast-commits] r4115 - in trunk/Class-C3-Componentised: .
lib/Class/C3 t
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Tue Mar 4 14:13:18 GMT 2008
Author: ash
Date: 2008-03-04 14:13:17 +0000 (Tue, 04 Mar 2008)
New Revision: 4115
Modified:
trunk/Class-C3-Componentised/Changes
trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
trunk/Class-C3-Componentised/t/01-basic.t
Log:
Make tests more resilient
Modified: trunk/Class-C3-Componentised/Changes
===================================================================
--- trunk/Class-C3-Componentised/Changes 2008-03-04 12:06:34 UTC (rev 4114)
+++ trunk/Class-C3-Componentised/Changes 2008-03-04 14:13:17 UTC (rev 4115)
@@ -1,5 +1,8 @@
Revision history for Class-C3-Componentised
+1.0002 4 Mar 2008
+ Make tests more resilient
+
1.0001 11 Aug 2007
Add missing dep on Test::Exception
Modified: trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
===================================================================
--- trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2008-03-04 12:06:34 UTC (rev 4114)
+++ trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2008-03-04 14:13:17 UTC (rev 4115)
@@ -146,18 +146,6 @@
Class::Inspector->installed($f_class);
}
-# Returns a true value if the specified class is installed and loaded
-# successfully, throws an exception if the class is found but not loaded
-# successfully, and false if the class is not installed
-sub _load_optional_class {
- my ($class, $f_class) = @_;
- if ($class->ensure_class_found($f_class)) {
- $class->ensure_class_loaded($f_class);
- return 1;
- } else {
- return 0;
- }
-}
=head2 inject_base
Modified: trunk/Class-C3-Componentised/t/01-basic.t
===================================================================
--- trunk/Class-C3-Componentised/t/01-basic.t 2008-03-04 12:06:34 UTC (rev 4114)
+++ trunk/Class-C3-Componentised/t/01-basic.t 2008-03-04 14:13:17 UTC (rev 4115)
@@ -2,18 +2,23 @@
use warnings;
use FindBin;
-use lib "$FindBin::Bin/lib";
-
use Test::More;
use Test::Exception;
+use lib "$FindBin::Bin/lib";
+
+
plan tests => 3;
use_ok('MyModule');
MyModule->load_components('Foo');
-throws_ok { MyModule->load_components('+Foo'); } qr/^Can't locate Foo.pm in \@INC/;
+# Clear down inc so ppl dont mess us up with installing modules that we
+# expect not to exist
+ at INC = ();
+throws_ok { MyModule->load_components('+ClassC3ComponentFooThatShouldntExist'); } qr/^Can't locate ClassC3ComponentFooThatShouldntExist.pm in \@INC/;
+
is(MyModule->new->message, "Foo MyModule", "it worked");
More information about the Bast-commits
mailing list