use strict;
use warnings;
-use Test::More tests => 37;
+use Test::More tests => 39;
use Test::Exception;
BEGIN {
'count' => 'num_options',
'clear' => 'clear_options',
'delete' => 'delete_option',
+ 'exists' => 'has_option',
},
curries => {
'set' => {
num_options
delete_option
clear_options
+ has_option
];
ok(!$stuff->has_options, '... we have no options');
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');
is_deeply($stuff->options, { foo => 'bar' }, '... got options now');
lives_ok {
$stuff->set_quantity(4);
} '... options added okay with defaults';
-is_deeply($stuff->options, {quantity => 4});
+is_deeply($stuff->options, {quantity => 4}, '... returns what we expect');
lives_ok {
Stuff->new(options => { foo => 'BAR' });
'count' => 'num_options',
'clear' => 'clear_options',
'delete' => 'delete_option',
+ 'exists' => 'has_option',
}, '... got the right provies mapping');
is($options->type_constraint->type_parameter, 'Str', '... got the right container type');