From: gfx Date: Sun, 4 Oct 2009 07:49:40 +0000 (+0900) Subject: Add a test for find_attribute_by_name() using t::lib::Test::Mouse X-Git-Tag: 0.37_02~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=8447b3b14d69fc39851e6f1a3024f88c443009f4 Add a test for find_attribute_by_name() using t::lib::Test::Mouse --- diff --git a/t/007-attributes.t b/t/007-attributes.t index 4edd2d0..ae538e6 100644 --- a/t/007-attributes.t +++ b/t/007-attributes.t @@ -1,9 +1,12 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 15; +use Test::More tests => 18; use Test::Exception; +use lib 't/lib'; +use Test::Mouse; + do { package Class; use Mouse; @@ -30,6 +33,10 @@ do { ok(!Class->can('x'), "No accessor is injected if 'is' has no value"); can_ok('Class', 'y', 'z'); +has_attribute_ok 'Class', 'x'; +has_attribute_ok 'Class', 'y'; +has_attribute_ok 'Class', 'z'; + my $object = Class->new; ok(!$object->can('x'), "No accessor is injected if 'is' has no value"); diff --git a/t/010_basics/013_create.t b/t/010_basics/013_create.t index ba4ac52..1d1d28f 100755 --- a/t/010_basics/013_create.t +++ b/t/010_basics/013_create.t @@ -46,7 +46,7 @@ throws_ok { ); } qr/You must pass an ARRAY ref of roles/; -ok !Made::Of::Fail->isa('UNIVERSAL'), "did not create Made::Of::Fail"; +ok !Mouse::Util::is_class_loaded('Made::Of::Fail'), "did not create Made::Of::Fail"; dies_ok { Mouse::Meta::Class->create(