Skip to content

Files

Latest commit

 

History

History
43 lines (35 loc) · 710 Bytes

Minitest-NonPublicTestMethod.md

File metadata and controls

43 lines (35 loc) · 710 Bytes

Pattern: Use of non-public test method

Issue: -

Description

Detects non public (marked as private or protected) test methods. Minitest runs only test methods which are public.

Examples

# bad
class FooTest
  private # or protected
  def test_does_something
    assert_equal 42, do_something
  end
end

# good
class FooTest
  def test_does_something
    assert_equal 42, do_something
  end
end

# good (not a test case name)
class FooTest
  private # or protected
  def does_something
    assert_equal 42, do_something
  end
end

# good (no assertions)
class FooTest
  private # or protected
  def test_does_something
    do_something
  end
end