Skip to content

Files

Latest commit

 

History

History
27 lines (19 loc) · 428 Bytes

Minitest-ReturnInTestMethod.md

File metadata and controls

27 lines (19 loc) · 428 Bytes

Pattern: Use of return in test method

Issue: -

Description

Enforces the use of skip instead of return in test methods.

Examples

# bad
def test_something
  return if condition?
  assert_equal(42, something)
end

# good
def test_something
  skip if condition?
  assert_equal(42, something)
end

Further Reading