Merge branch 'master' into attribute_helpers
[gitmo/Moose.git] / t / 020_attributes / 010_attribute_delegation.t
index a47d7a7..e3a5f0a 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 91;
+use Test::More tests => 92;
 use Test::Exception;
 
 
@@ -29,7 +29,11 @@ use Test::Exception;
     has 'foo' => (
         is      => 'rw',
         default => sub { Foo->new },
-        handles => { 'foo_bar' => 'bar', foo_baz => 'baz' }
+        handles => {
+            'foo_bar' => 'bar',
+            foo_baz => 'baz',
+            'foo_bar_to_20' => [ bar => [ 20 ] ],
+        },
     );
 }
 
@@ -83,6 +87,10 @@ is($bar->foo, $foo, '... assigned bar->foo with the new Foo');
 is($bar->foo->bar, 25, '... bar->foo->bar returned the right result');
 is($bar->foo_bar, 25, '... and bar->foo_bar delegated correctly again');
 
+# curried handles
+$bar->foo_bar_to_20;
+is($bar->foo_bar, 20, '... correctly curried a single argument');
+
 # -------------------------------------------------------------------
 # ARRAY handles
 # -------------------------------------------------------------------