X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Funit_utils_load_class.t;h=c2535d26d07eb3880b103b3ccf194b7bbf691e81;hp=6712f6749b700ed8d1a5336036f9aa06e6df045a;hb=8e322ed0b39da75b8d888025782f496ca781527f;hpb=9af4ee013b23e7241d4664ea39952fa3b20f4b7f diff --git a/t/unit_utils_load_class.t b/t/unit_utils_load_class.t index 6712f67..c2535d2 100644 --- a/t/unit_utils_load_class.t +++ b/t/unit_utils_load_class.t @@ -1,12 +1,17 @@ use strict; use warnings; -use Test::More tests => 18; -use Class::MOP; - +use Test::More; +use Class::Load 'is_class_loaded'; use lib "t/lib"; -BEGIN { use_ok("Catalyst::Utils") }; +BEGIN { + if ($^O =~ m/^MSWin/) { + plan skip_all => 'Skipping this test on Windows until someone with Windows has time to fix it'; + } + + use_ok("Catalyst::Utils"); +} { package This::Module::Is::Not::In::Inc::But::Does::Exist; @@ -19,11 +24,11 @@ $SIG{__WARN__} = sub { $warnings++; }; -ok( !Class::MOP::is_class_loaded("TestApp::View::Dump"), "component not yet loaded" ); +ok( !is_class_loaded("TestApp::View::Dump"), "component not yet loaded" ); Catalyst::Utils::ensure_class_loaded("TestApp::View::Dump"); -ok( Class::MOP::is_class_loaded("TestApp::View::Dump"), "loaded ok" ); +ok( is_class_loaded("TestApp::View::Dump"), "loaded ok" ); is( $warnings, 0, "no warnings emitted" ); $warnings = 0; @@ -31,10 +36,10 @@ $warnings = 0; Catalyst::Utils::ensure_class_loaded("TestApp::View::Dump"); is( $warnings, 0, "calling again doesn't reaload" ); -ok( !Class::MOP::is_class_loaded("TestApp::View::Dump::Request"), "component not yet loaded" ); +ok( !is_class_loaded("TestApp::View::Dump::Request"), "component not yet loaded" ); Catalyst::Utils::ensure_class_loaded("TestApp::View::Dump::Request"); -ok( Class::MOP::is_class_loaded("TestApp::View::Dump::Request"), "loaded ok" ); +ok( is_class_loaded("TestApp::View::Dump::Request"), "loaded ok" ); is( $warnings, 0, "calling again doesn't reaload" ); @@ -54,7 +59,7 @@ is( $@, "foo", '$@ is untouched' ); undef $@; eval { Catalyst::Utils::ensure_class_loaded("This::Module::Is::Not::In::Inc::But::Does::Exist") }; -ok( !$@, "no error when loading non existent .pm that *does* have a symbol table entry" ); +ok( !$@, "no error when loading non existent .pm that *does* have a symbol table entry" ); undef $@; eval { Catalyst::Utils::ensure_class_loaded('Silly::File::.#Name') }; @@ -70,3 +75,4 @@ Catalyst::Utils::ensure_class_loaded("NullPackage"); is( $warnings, 1, 'Loading a package which defines no symbols warns'); is( $@, undef, '$@ still undef' ); +done_testing;