Tweaks and documenting Mouse::Exporter
[gitmo/Mouse.git] / t / 018-multiattr-has.t
index 8fb97f0..8458e89 100644 (file)
@@ -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(keys %{ Class->meta->get_attribute_map }, 3, "three attributes created");
+is_deeply([sort Class->meta->get_attribute_list], [sort qw/a b c/], "three attributes created");
 Class->new(a => 1, b => 2);
 
 is_deeply(\%trigger, { a => 1, b => 1 }, "correct triggers called");