Skip to content

Conversation

@github-actions
Copy link
Contributor

Rubocop challenge!

RSpec/LeadingSubject

Safe autocorrect: Yes
✅ The autocorrect a cop does is safe (equivalent) by design.

Description

Overview

Enforce that subject is the first definition in the test.

Examples

# bad
  let(:params) { blah }
  subject { described_class.new(params) }

  before { do_something }
  subject { described_class.new(params) }

  it { expect_something }
  subject { described_class.new(params) }
  it { expect_something_else }

# good
  subject { described_class.new(params) }
  let(:params) { blah }

# good
  subject { described_class.new(params) }
  before { do_something }

# good
  subject { described_class.new(params) }
  it { expect_something }
  it { expect_something_else }

Auto generated by rubocop_challenger

@mathieujobin mathieujobin merged commit ebbfadc into master Jul 26, 2022
@mathieujobin mathieujobin deleted the rubocop-challenge/20220714233459 branch July 26, 2022 05:37
smshuja pushed a commit to TheTalentEnterprise/webhook_system that referenced this pull request Jan 25, 2024
* 🚓 regenerate rubocop todo

* 🚓 RSpec/LeadingSubject

* 🚓 regenerate rubocop todo

Co-authored-by: Rubocop Challenger <rubocop@payrollhero.com>
Co-authored-by: Mathieu Jobin <mathieujobin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants