### ----------------------------------------------------
### -- Shodan
### -- Licenses: Artistic-2.0
### -- Authors: Sarah Fuller
### -- File: t/05-notifiers.rakutest
### ----------------------------------------------------
use Test;
use Shodan;

plan :skip-all<Author tests not required for installation> unless (%*ENV{'SHODAN_TESTING'});
plan 6;

my $shodan = Shodan.new(api-key => %*ENV{'SHODAN_API_KEY'});

isa-ok($shodan.notifiers(), Hash, '.notifiers');

isa-ok($shodan.notifier-providers(), Hash, '.notifier-providers');

my $notifier;
isa-ok($notifier = $shodan.notifier-create(provider => 'email', description => 'Email notifier', args => {to => 'jmath@shodan.io'}), Hash, '.notifier-create');

isa-ok($shodan.notifier(id => $notifier{'id'}), Hash, '.notifier');

isa-ok($shodan.notifier-update(id => $notifier{'id'}, args => {to => 'test3@shodan.io'}), Hash, '.notifier-update');

isa-ok($shodan.notifier-delete(id => $notifier{'id'}), Hash, '.notifier-delete');

done-testing;


