OptimumCredo.Check.Readability.TestNameRepeatsSubject (OptimumCredo v0.5.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of low and works with any version of Elixir.

Explanation

The describe already names the function, so the test name should state the behaviour only.

Bad:

describe "calc_lines/1" do
  test "calc_lines/1 returns zero for blank input" do

Good:

describe "calc_lines/1" do
  test "returns zero for blank input" do

Check-Specific Parameters

Use the following parameters to configure this check:

:min_subject_length

Function names shorter than this are not checked.

This parameter defaults to 5.

:ignore_paths

Path fragments to skip.

This parameter defaults to ["test/support/"].

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.