Skip to content

Commit 2128e89

Browse files
committed
Only throws_like accepts a string as well
1 parent a939132 commit 2128e89

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

S24-testing.pod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,16 @@ test only if B<all> tests in the block, pass.
208208

209209
=head2 dies_ok(), lives_ok(), throws_like()
210210

211-
sub dies_ok($code, $desc?) is export { ... }
212-
sub lives_ok($code, $desc?) is export { ... }
211+
sub dies_ok(Callable $code, $desc?) is export { ... }
212+
sub lives_ok(Callable $code, $desc?) is export { ... }
213213
sub throws_like($code, $exception_type, *%matcher) is export { ... }
214214

215-
These three functions accept a first parameter that is either something
216-
C<Callable>, or something that can be C<EVAL>led.
217-
218215
The C<dies_ok()> passes the test if the given code throws an exception.
219216
The C<lives_ok()> passes the test if the given code B<does not> throw an
220217
exception.
221218

222-
The C<throws_like> function checks whether the given code throws a specific
219+
The C<throws_like> function checks whether the given code (specified as either
220+
something C<Callable>, or as a something to be C<EVAL>led) throws a specific
223221
exception (either specified as a Type object, or as a string). If an
224222
exception was thrown, it will also try to match the matcher hash, in which
225223
the key is the name of the method to be called on the exception, and the

0 commit comments

Comments
 (0)