Added defined for AH
[gitmo/MooseX-AttributeHelpers.git] / t / 003_basic_hash.t
index 7b1b779..b9dfbc0 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 40;
+use Test::More tests => 42;
 use Test::Exception;
 
 BEGIN {
@@ -28,6 +28,7 @@ BEGIN {
             'clear'  => 'clear_options',
             'delete' => 'delete_option',
             'exists' => 'has_option',
+            'defined'=> 'is_defined'
         },
         curries   => {
             'set'    => {
@@ -47,6 +48,7 @@ can_ok($stuff, $_) for qw[
     num_options
     delete_option
     clear_options
+    is_defined
     has_option
 ];
 
@@ -60,6 +62,8 @@ lives_ok {
     $stuff->set_option(foo => 'bar');
 } '... set the option okay';
 
+ok($stuff->is_defined('foo'), '... foo is defined');
+
 ok($stuff->has_options, '... we have options');
 is($stuff->num_options, 1, '... we have 1 option(s)');
 ok($stuff->has_option('foo'), '... we have a foo option');
@@ -134,6 +138,7 @@ is_deeply($options->provides, {
     'count'  => 'num_options',
     'clear'  => 'clear_options',
     'delete' => 'delete_option',
+    'defined'=> 'is_defined',
     'exists' => 'has_option',
 }, '... got the right provies mapping');