isa => 'HashRef[Str]',
default => sub { {} },
provides => {
- 'set' => 'set_option',
- 'get' => 'get_option',
- 'empty' => 'has_options',
- 'count' => 'num_options',
+ 'set' => 'set_option',
+ 'get' => 'get_option',
+ 'empty' => 'has_options',
+ 'count' => 'num_options',
+ 'delete' => 'delete_option',
}
);
}
get_option
has_options
num_options
+ delete_option
];
ok(!$stuff->has_options, '... we have no options');
is($stuff->get_option('foo'), 'bar', '... got the right option');
lives_ok {
+ $stuff->delete_option('bar');
+} '... deleted the option okay';
+
+is($stuff->num_options, 1, '... we have 1 option(s)');
+is_deeply($stuff->options, { foo => 'bar' }, '... got more options now');
+
+lives_ok {
Stuff->new(options => { foo => 'BAR' });
} '... good constructor params';