Update some doc
[gitmo/Mouse.git] / t / 018-multiattr-has.t
CommitLineData
c3398f5b 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More tests => 3;
5
6my %trigger;
7do {
8 package Class;
9 use Mouse;
10
11 has [qw/a b c/] => (
12 is => 'rw',
13 trigger => sub {
14 my ($self, $value, $attr) = @_;
15 $trigger{$attr->name}++;
16 },
17 );
18};
19
20can_ok(Class => qw/a b c/);
f89acace 21is(keys %{ Class->meta->get_attribute_map }, 3, "three attributes created");
c3398f5b 22Class->new(a => 1, b => 2);
23
24is_deeply(\%trigger, { a => 1, b => 1 }, "correct triggers called");
25