Skip to content

Files

Latest commit

 

History

History
24 lines (18 loc) · 408 Bytes

Minitest-UnreachableAssertion.md

File metadata and controls

24 lines (18 loc) · 408 Bytes

Pattern: Unreachable assertion

Issue: -

Description

Checks for assert_raises has an assertion method at the bottom of block because the assertion will be never reached.

Examples

# bad
assert_raises FooError do
  obj.occur_error
  assert_equal('foo', obj.bar) # Never asserted.
end

# good
assert_raises FooError do
  obj.occur_error
end
assert_equal('foo', obj.bar)