use strict;
use warnings;
+use Scalar::Util;
+
use Test::More tests => 17;
BEGIN {
::is($bar_attr->reader, 'get_bar', '... the bar attribute has the reader get_bar');
::is($bar_attr->writer, 'set_bar', '... the bar attribute has the writer set_bar');
- ::is($bar_attr->associated_class, Foo->meta, '... and the bar attribute is associated with Foo->meta');
+ ::is($bar_attr->associated_class, Foo->meta, '... and the bar attribute is associated with Foo->meta');
Foo->meta->add_attribute('bar' =>
reader => 'assign_bar'
::can_ok('Foo', 'assign_bar');
::ok(Foo->meta->has_attribute('bar'), '... Foo still has the attribute bar');
- my $bar_attr2 = Foo->meta->get_attribute('bar');
+ my $bar_attr2 = Foo->meta->get_attribute('bar');
::isnt($bar_attr, $bar_attr2, '... this is a new bar attribute');
::isnt($bar_attr->associated_class, Foo->meta, '... and the old bar attribute is no longer associated with Foo->meta');