Skip to content

Commit 1913c1d

Browse files
committed
Use RuboCop RSpec 2.18
This commit makes this repo to use RuboCop RSpec 2.18 and suppress the following new offenses: ```consle % bundle exec rake (snip) Offenses: spec/project_spec.rb:22:9: C: [Correctable] RSpec/PredicateMatcher: Prefer using include? over include matcher. expect(description).not_to include("\n") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/rubocop/cop/rails/validation_spec.rb:11:7: C: [Correctable] RSpec/PredicateMatcher: Prefer using include? over include matcher. expect(offenses.first.message).to include(described_class::ALLOWLIST[number]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 279 files inspected, 2 offenses detected, 2 offenses autocorrectable ````
1 parent 94ccd43 commit 1913c1d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ gem 'rake'
1111
gem 'rspec'
1212
gem 'rubocop', github: 'rubocop/rubocop'
1313
gem 'rubocop-performance', '~> 1.15.0'
14-
gem 'rubocop-rspec', '~> 2.16.0'
14+
gem 'rubocop-rspec', '~> 2.18.0'
1515
gem 'simplecov'
1616
gem 'test-queue'
1717
gem 'yard', '~> 0.9'

spec/project_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
cop_names.each do |name|
2020
description = config[name]['Description']
2121
expect(description.nil?).to be(false)
22-
expect(description).not_to include("\n")
22+
expect(description.include?("\n")).to be(false)
2323

2424
start_with_subject = description.match(/\AThis cop (?<verb>.+?) .*/)
2525
suggestion = start_with_subject[:verb]&.capitalize if start_with_subject

spec/rubocop/cop/rails/validation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
described_class::RESTRICT_ON_SEND.each_with_index do |validation, number|
99
it "registers an offense for #{validation}" do
1010
offenses = inspect_source("#{validation} :name")
11-
expect(offenses.first.message).to include(described_class::ALLOWLIST[number])
11+
expect(offenses.first.message.include?(described_class::ALLOWLIST[number])).to be(true)
1212
end
1313
end
1414

0 commit comments

Comments
 (0)