Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

elaborate on previous advice

  • Loading branch information...
commit a0a20272111a62196b2b1cd94a4fae1c2d056512 1 parent 97571f9
@rjbs authored
Showing with 6 additions and 3 deletions.
  1. +1 −0  Changes
  2. +5 −3 lib/Test/
1  Changes
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}
+ advise against using isnt(exception{...},undef)
0.008 2011-11-06 21:10:14 America/New_York
no changes since 0.007
8 lib/Test/
@@ -87,9 +87,11 @@ B<Achtung>: One final bad idea:
isnt( exception { ... }, undef, "my code died!");
It's true that this tests that your code died, but you should really test that
-it died I<for the right reason>. If you're expecting an inspectable exception
-with an identifier or class, test that. If you're expecting a string
-exception, consider using C<like>.
+it died I<for the right reason>. For example, if you make an unrelated mistake
+in the block, like using the wrong dereference, your test will pass even though
+the code to be tested isn't really run at all. If you're expecting an
+inspectable exception with an identifier or class, test that. If you're
+expecting a string exception, consider using C<like>.
Please sign in to comment.
Something went wrong with that request. Please try again.