return sub { CORE::exists $reader->($_[0])->{$_[1]} ? 1 : 0 };
}
+sub defined : method {
+ my ($attr, $reader, $writer) = @_;
+ return sub { CORE::defined $reader->($_[0])->{$_[1]} ? 1 : 0 };
+}
+
sub get : method {
my ($attr, $reader, $writer) = @_;
return sub {
use strict;
use warnings;
-use Test::More tests => 40;
+use Test::More tests => 42;
use Test::Exception;
BEGIN {
'clear' => 'clear_options',
'delete' => 'delete_option',
'exists' => 'has_option',
+ 'defined'=> 'is_defined'
},
curries => {
'set' => {
num_options
delete_option
clear_options
+ is_defined
has_option
];
$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');
'count' => 'num_options',
'clear' => 'clear_options',
'delete' => 'delete_option',
+ 'defined'=> 'is_defined',
'exists' => 'has_option',
}, '... got the right provies mapping');