Skip to content
Snippets Groups Projects
Commit fec4f0d8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

WWW::Efa::Error::Setup: Add accessors for inernals

parent 7a656673
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......@@ -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'",
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment