From: Florian Ragwitz Date: Fri, 17 Oct 2008 03:18:25 +0000 (+0000) Subject: Add a failing testcase for a sane Class::MOP::load_class('__PACKAGE__') error message. X-Git-Tag: 0.68~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bbf7fe2b79abe6dbee39af53a29e471cf62069e;p=gitmo%2FClass-MOP.git Add a failing testcase for a sane Class::MOP::load_class('__PACKAGE__') error message. --- diff --git a/t/083_load_class.t b/t/083_load_class.t index c9ee05f..1951cf5 100644 --- a/t/083_load_class.t +++ b/t/083_load_class.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 23; use Test::Exception; require Class::MOP; @@ -20,6 +20,10 @@ ok(Class::MOP::_is_valid_class_name('Foo::Bar'), q{'Foo::Bar' is a valid class n ok(Class::MOP::_is_valid_class_name('Foo_::Bar2'), q{'Foo_::Bar2' is a valid class name}); throws_ok { Class::MOP::load_class('bogus name') } qr/Invalid class name \(bogus name\)/; +throws_ok { + Class::MOP::load_class('__PACKAGE__') +} qr/__PACKAGE__\.pm.*\@INC/, 'errors sanely on __PACKAGE__.pm'; + my $meta = Class::MOP::load_class('BinaryTree'); ok($meta, "successfully loaded the class BinaryTree"); is($meta->name, "BinaryTree", "load_class returns the metaclass");