Skip to content

Add a warning when doc string is not a string

Rodrigo Muino Tomonari requested to merge deprecate-unusual-docstrings into 4-0-dev

Created by: pirj

Based on https://github.com/rspec/rspec-core/issues/2921#issuecomment-981149916

The first argument should be:

For example groups:

  1. a String. Either a textual description (context "in the afternoon"), or a quoted class name (describe "AdminUser")
  2. a Class (describe AdminUser)
  3. a NilClass (context do)

For examples:

  1. a String. A textual description (it 'throws raw eggs at open source maintainers')
  2. a NilClass (specify do)

For shared examples/contexts there is already an Shared example group names can only be a string, symbol or module error.

Am I missing something?

Semi-related side note: we decided not to remove a semi-related described_class in RSpec 4, even though it was previously planned.

Merge request reports