From: Matt S Trout Date: Wed, 6 Aug 2008 19:54:56 +0000 (+0000) Subject: test calling has() from outside of package X-Git-Tag: 0_55_01~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04ec7c8a2c555c65365a27a71de24819c428b0a0;p=gitmo%2FMoose.git test calling has() from outside of package --- diff --git a/t/020_attributes/012_misc_attribute_tests.t b/t/020_attributes/012_misc_attribute_tests.t index a8f4bc0..52f6e14 100644 --- a/t/020_attributes/012_misc_attribute_tests.t +++ b/t/020_attributes/012_misc_attribute_tests.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 43; +use Test::More tests => 47; use Test::Exception; @@ -251,3 +251,14 @@ use Test::Exception; } +{ + package OutOfClassTest; + + use Moose; +} + +lives_ok { OutOfClassTest::has('foo'); } 'create attr via direct sub call'; +lives_ok { OutOfClassTest->can('has')->('bar'); } 'create attr via can'; + +ok(OutOfClassTest->meta->get_attribute('foo'), 'attr created from sub call'); +ok(OutOfClassTest->meta->get_attribute('bar'), 'attr created from can');