Merge branch 'master' of github.com:gfx/p5-Mouse-temporary
Fuji, Goro [Sat, 12 Nov 2011 09:37:42 +0000 (18:37 +0900)]
lib/Mouse.pm
t/001_mouse/060-threads.t

index 3a9e4b2..fdd51cf 100644 (file)
@@ -347,7 +347,7 @@ Use of this feature requires L<Scalar::Util>!
 
 =item C<< trigger => CodeRef >>
 
-Any time the attribute's value is set (either through the accessor or the constructor), the trigger is called on it. The trigger receives as arguments the instance, the new value, and the attribute instance.
+Any time the attribute's value is set (either through the accessor or the constructor), the trigger is called on it. The trigger receives as arguments the instance, and the new value.
 
 =item C<< builder => Str >>
 
index 051a926..c6dd876 100644 (file)
@@ -20,6 +20,12 @@ use if $Test::More::VERSION >= 2.00, 'Test::More',
         is => 'rw',
         isa => 'Foo',
     );
+    has bar => (
+        is => 'rw',
+
+        lazy    => 1,
+        default => sub { 42 },
+    );
 
     package Foo;
     use Mouse;
@@ -50,6 +56,8 @@ threads->create(sub{
     $x->foo(Foo->new(value => 20));
 
     is $x->foo->value, 20;
+
+    is $x->bar, 42, 'callback for default';
 })->join();
 
 is $o->foo->value, 42;