summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-08-14 00:05:28 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-08-14 00:05:28 +0200
commitfec4f0d857fb35a7c6cd35a51694671651b23df7 (patch)
tree13aa5859e91e97285a204aa6c09c9de5cbc37291
parent7a656673609e37f4985393e5e95572176a26566e (diff)
WWW::Efa::Error::Setup: Add accessors for inernals
-rw-r--r--lib/WWW/Efa/Error/Setup.pm18
-rw-r--r--t/50-www-efa.t6
2 files changed, 21 insertions, 3 deletions
diff --git a/lib/WWW/Efa/Error/Setup.pm b/lib/WWW/Efa/Error/Setup.pm
index f35dcee..386613b 100644
--- a/lib/WWW/Efa/Error/Setup.pm
+++ b/lib/WWW/Efa/Error/Setup.pm
@@ -60,4 +60,22 @@ sub as_string {
);
}
+=head2 $error->option()
+
+Returns the option which caused the error.
+
+=head2 $error->value()
+
+Returns the value which caused the error.
+
+=head2 $error->message()
+
+Returns a message describing what went wrong and how to fix it.
+
+=cut
+
+sub option { return $_[0]->{'key'} }
+sub value { return $_[0]->{'value'} }
+sub message { return $_[0]->{'message'} }
+
1;
diff --git a/t/50-www-efa.t b/t/50-www-efa.t
index e527272..bae1e94 100644
--- a/t/50-www-efa.t
+++ b/t/50-www-efa.t
@@ -80,15 +80,15 @@ sub is_efa_err {
isa_ok($efa->{'error'}, 'WWW::Efa::Error::Setup');
is(
- $efa->{'error'}->{'key'}, $key,
+ $efa->{'error'}->option(), $key,
"$key => $val: Error: Correct key",
);
is(
- $efa->{'error'}->{'value'}, $val_want,
+ $efa->{'error'}->value(), $val_want,
"$key => $val: Error: Correct valuef",
);
is(
- $efa->{'error'}->{'message'}, $str,
+ $efa->{'error'}->message(), $str,
"$key => $val: Error: String is '$str'",
);
}