X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F800_shikabased%2F008-create_class.t;h=4c8012275314ecbd5a3e414f209091979a1adc54;hb=a8391b1105f66a71c29b57fd441d0c02f1897e54;hp=687671e5fbc253723b584dde01f083ddffd018db;hpb=ad022aac12ce95ee336af9dde0758ae98037f3ab;p=gitmo%2FMouse.git diff --git a/t/800_shikabased/008-create_class.t b/t/800_shikabased/008-create_class.t index 687671e..4c80122 100644 --- a/t/800_shikabased/008-create_class.t +++ b/t/800_shikabased/008-create_class.t @@ -1,7 +1,7 @@ use strict; use warnings; use Mouse (); -use Test::More tests => 20; +use Test::More tests => 23; use Test::Exception; # error handling @@ -27,11 +27,6 @@ throws_ok { ); } qr/You must pass a HASH ref of methods/; - -throws_ok { - Mouse::Meta::Class->create() -} qr/You must pass a package name/; - # normal cases isa_ok(Mouse::Meta::Class->create("FooBar"), "Mouse::Meta::Class"); is FooBar->meta->name, "FooBar"; @@ -88,3 +83,16 @@ ok !$anon_pkg1->can('meta'); ok $anon_pkg2->can('meta'), 'cache => 1 makes it immortal'; +my $obj; +{ + my $anon = Mouse::Meta::Class->create_anon_class(superclasses => ['Mouse::Object']); + lives_ok{ $anon->make_immutable() } 'make anon class immutable'; + $obj = $anon->name->new(); +} + +isa_ok $obj, 'Mouse::Object'; +can_ok $obj, 'meta'; +lives_and{ + isa_ok $obj->meta, 'Mouse::Meta::Class'; +}; +