New tests to cover new handling of register-time configuration.

This commit is contained in:
Jonathan Hall 2014-09-16 14:04:37 -05:00
parent 3d97773827
commit f2bcd3736a

View File

@ -14,7 +14,7 @@ sub register_tests {
eval 'use ClamAV::Client'; ## no critic (Stringy) eval 'use ClamAV::Client'; ## no critic (Stringy)
skip "Could not load ClamAV::Client", 4 skip "Could not load ClamAV::Client", 4
if $@; if $@;
$self->register_test('test_register', 3); $self->register_test('test_register', 6);
$self->register_test('test_get_clamd', 1); $self->register_test('test_get_clamd', 1);
} }
$self->register_test('test_err_and_return', 2); $self->register_test('test_err_and_return', 2);
@ -28,9 +28,17 @@ sub register_tests {
sub test_register { sub test_register {
my $self = shift; my $self = shift;
ok( $self->{_args}{deny_viruses} eq 'yes', "deny_viruses"); ok( $self->{_args}{deny_viruses}, "deny_viruses 1");
ok( $self->{_args}{max_size} == 1024, "max_size"); is( $self->{_args}{max_size}, 1024, "max_size 1");
ok( $self->{_args}{scan_all} == 1, "scan_all"); ok( $self->{_args}{scan_all}, "scan_all 1");
my $qp = $self->qp;
# Re-initialize the plugin with some different options
$self->register($qp,qw( scan_all 0 max_size 200 deny_viruses no));
ok( ! $self->{_args}{deny_viruses}, "deny_viruses 2");
is( $self->{_args}{max_size}, 200, "max_size 2");
ok( !$self->{_args}{scan_all}, "scan_all 2");
}; };
sub test_err_and_return { sub test_err_and_return {