summaryrefslogtreecommitdiff
path: root/t/50-www-efa.t
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-08-08 13:31:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-08-08 13:31:53 +0200
commit311e480283c8eb693419e7abada749fb80e10dda (patch)
treeb2dd3ceb9e43ea07f80df9ea7539f5166971d4e0 /t/50-www-efa.t
parent5e15ca49a16f44e8229e47e44901180c2add5b18 (diff)
Split up Error.pm into WWW::Efa::Error::{Backend,Setup}
Diffstat (limited to 't/50-www-efa.t')
-rw-r--r--t/50-www-efa.t27
1 files changed, 14 insertions, 13 deletions
diff --git a/t/50-www-efa.t b/t/50-www-efa.t
index 8a54025..e527272 100644
--- a/t/50-www-efa.t
+++ b/t/50-www-efa.t
@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.010;
-use Test::More tests => 127;
+use Test::More tests => 135;
BEGIN {
use_ok('WWW::Efa');
@@ -77,28 +77,29 @@ sub is_efa_err {
"conf ok: $key => $val",
);
+ isa_ok($efa->{'error'}, 'WWW::Efa::Error::Setup');
+
is(
- $efa->{'error'}->{'source'}, 'internal',
- "$key => $val: Error source is internal",
+ $efa->{'error'}->{'key'}, $key,
+ "$key => $val: Error: Correct key",
);
is(
- $efa->{'error'}->{'type'}, 'conf',
- "$key => $val: Error type is conf",
+ $efa->{'error'}->{'value'}, $val_want,
+ "$key => $val: Error: Correct valuef",
);
-
- is_deeply(
- $efa->{'error'}->{'data'}, [$key, $val_want, $str],
- "$key => $val: Error data is [$key, $val_want, $str]",
+ is(
+ $efa->{'error'}->{'message'}, $str,
+ "$key => $val: Error: String is '$str'",
);
}
is_efa_post('ignored', 'ignored');
my $efa = new_ok('WWW::Efa' => []);
-isa_ok($efa->{'error'}, 'WWW::Efa::Error');
-is($efa->{'error'}->{'source'}, 'internal');
-is($efa->{'error'}->{'type'}, 'conf' );
-is_deeply($efa->{'error'}->{'data'}, ['place', 'origin', 'Need at least two elements']);
+isa_ok($efa->{'error'}, 'WWW::Efa::Error::Setup');
+is($efa->{'error'}->{'key'}, 'place');
+is($efa->{'error'}->{'value'}, 'origin');
+is($efa->{'error'}->{'message'}, 'Need at least two elements');
is_efa_post(
'via', ['MH', 'HBf'],