X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F018-multiattr-has.t;h=acd258be2ae558bf056657c6576324de3047b11a;hb=faa45e546ff56d48fbd9fec43d1fc014520ca0e3;hp=49b4d3da31000ee2ba2f32e0ae12089f2c6b3b6e;hpb=c3398f5bd45f2851b7cd40ca9823bcf7d2378469;p=gitmo%2FMouse.git diff --git a/t/018-multiattr-has.t b/t/018-multiattr-has.t index 49b4d3d..acd258b 100644 --- a/t/018-multiattr-has.t +++ b/t/018-multiattr-has.t @@ -8,17 +8,18 @@ do { package Class; use Mouse; - has [qw/a b c/] => ( - is => 'rw', - trigger => sub { - my ($self, $value, $attr) = @_; - $trigger{$attr->name}++; - }, - ); + for my $attr (qw/a b c/) { + has $attr => ( + is => 'rw', + trigger => sub { + $trigger{$attr}++; + }, + ); + } }; can_ok(Class => qw/a b c/); -is(Class->meta->attributes, 3, "three attributes created"); +is(keys %{ Class->meta->get_attribute_map }, 3, "three attributes created"); Class->new(a => 1, b => 2); is_deeply(\%trigger, { a => 1, b => 1 }, "correct triggers called");