Less obtrusive addition of test hooks

This commit is contained in:
Jared Johnson 2014-12-17 18:37:21 -06:00
parent 63d423c896
commit 7d33c42d35

View File

@ -87,7 +87,7 @@ sub validate_password {
sub fake_config { sub fake_config {
my $self = shift; my $self = shift;
my $fake_config = {@_}; my $fake_config = {@_};
$self->qp->hooks->{config} = [ unshift @{ $self->qp->hooks->{config} ||= [] },
{ {
name => '___FakeHook___', name => '___FakeHook___',
code => sub { code => sub {
@ -95,8 +95,7 @@ sub fake_config {
return DECLINED if ! exists $fake_config->{$conf}; return DECLINED if ! exists $fake_config->{$conf};
return OK, $fake_config->{$conf}; return OK, $fake_config->{$conf};
}, },
}, };
];
} }
sub unfake_config { sub unfake_config {