X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F005_attributes.t;h=239d2a2efdc09f048827cf876910fe9615eecb44;hb=b25109b1bb81739adfbb5135176792bf5d0e3feb;hp=73bda5b89cdfadd3a341f13fbfea65d91c4eb568;hpb=804f7d24a1d915091c94017734c78ab5cbdfa181;p=gitmo%2FClass-MOP.git diff --git a/t/005_attributes.t b/t/005_attributes.t index 73bda5b..239d2a2 100644 --- a/t/005_attributes.t +++ b/t/005_attributes.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 43; +use Test::More tests => 47; use Test::Exception; BEGIN { @@ -53,6 +53,10 @@ my $BAR_ATTR_2 = Class::MOP::Attribute->new('$bar'); ::ok($meta->has_attribute('$bar'), '... Bar has $bar attribute'); ::is($meta->get_attribute('$bar'), $BAR_ATTR, '... got the right attribute back for Bar'); + my $attr = $meta->get_attribute('$bar'); + ::is($attr->get_read_method, 'bar', '... got the right read method for Bar'); + ::is($attr->get_write_method, 'bar', '... got the right write method for Bar'); + ::ok($meta->has_method('bar'), '... an accessor has been created'); ::isa_ok($meta->get_method('bar'), 'Class::MOP::Method::Accessor'); } @@ -67,6 +71,10 @@ my $BAR_ATTR_2 = Class::MOP::Attribute->new('$bar'); ::ok($meta->has_attribute('$baz'), '... Baz has $baz attribute'); ::is($meta->get_attribute('$baz'), $BAZ_ATTR, '... got the right attribute back for Baz'); + my $attr = $meta->get_attribute('$baz'); + ::is($attr->get_read_method, 'get_baz', '... got the right read method for Baz'); + ::is($attr->get_write_method, 'set_baz', '... got the right write method for Baz'); + ::ok($meta->has_method('get_baz'), '... a reader has been created'); ::ok($meta->has_method('set_baz'), '... a writer has been created');