Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 492 Bytes

Minitest-UnspecifiedException.md

File metadata and controls

23 lines (15 loc) · 492 Bytes

Pattern: Unspecified exception in assert_raises

Issue: -

Description

Checks for a specified error in assert_raises.

Examples

# bad
assert_raises { raise FooException }
assert_raises('This should have raised') { raise FooException }

# good
assert_raises(FooException) { raise FooException }
assert_raises(FooException, 'This should have raised') { raise FooException }

Further Reading