DEV: Add rubocop-rspec (#9288)

This adds rubocop-rspec, and enables some cops that were either already passing or are passing now, after fixing them in this commit.

Some new cops are disabled for now, with annotation: "TODO" or "To be decided". Those either need to be discussed first, or require manual changes, or the number of found and fixed offenses is too large to bundle them up in a single PR.

Includes:

* DEV: Update rubocop's `TargetRubyVersion` to 2.6
* DEV: Enable RSpec/VoidExpect
* DEV: Enable RSpec/SharedContext
* DEV: Enable RSpec/EmptyExampleGroup (Removed an obsolete empty spec file)
* DEV: Enable RSpec/ItBehavesLike
* DEV: Remove RSpec/ScatteredLet (It's too strict, as it doesn't recognize fab! as a let-like)
* DEV: Remove RSpec/MultipleExpectations
This commit is contained in:
Jarek Radosz
2020-03-27 17:35:40 +01:00
committed by GitHub
parent b2b7afd310
commit 7ff889574d
9 changed files with 224 additions and 17 deletions

View File

@@ -1122,7 +1122,7 @@ describe Topic do
context 'closed' do
let(:status) { 'closed' }
it_should_behave_like 'a status that closes a topic'
it_behaves_like 'a status that closes a topic'
it 'should archive group message' do
group = Fabricate(:group)
@@ -1135,7 +1135,7 @@ describe Topic do
context 'autoclosed' do
let(:status) { 'autoclosed' }
it_should_behave_like 'a status that closes a topic'
it_behaves_like 'a status that closes a topic'
context 'topic was set to close when it was created' do
it 'includes the autoclose duration in the moderator post' do