From b69aabbe591bfbbb800ce4951851fdc5de9dc638 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 7 Jan 2024 12:31:07 +0900 Subject: [PATCH] Use RuboCop RSpec 2.26 This commit makes this repo to use RuboCop RSpec 2.26 and suppress the following new offenses: ```console $ bundle exec rubocop (snip) spec/project_spec.rb:261:11: C: [Correctable] RSpec/ExampleWording: Do not use the future tense when describing your tests. it 'will not have a directory' do ^^^^^^^^^^^^^^^^^^^^^^^^^ spec/rubocop/cop/performance/count_spec.rb:185:9: C: [Correctable] RSpec/ExampleWording: Do not use the future tense when describing your tests. it 'will not raise an error for Bundler.setup' do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/rubocop/cop/performance/count_spec.rb:189:9: C: [Correctable] RSpec/ExampleWording: Do not use the future tense when describing your tests. it 'will not raise an error for RakeTask.new' do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` --- Gemfile | 2 +- spec/project_spec.rb | 2 +- spec/rubocop/cop/performance/count_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index cfb3187781..1db6966f09 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'bump', require: false gem 'rake' gem 'rspec' gem 'rubocop', github: 'rubocop/rubocop' -gem 'rubocop-rspec', '~> 2.25.0' +gem 'rubocop-rspec', '~> 2.26.0' gem 'simplecov' gem 'test-queue' gem 'yard', '~> 0.9' diff --git a/spec/project_spec.rb b/spec/project_spec.rb index a967b1e9fc..342f226fd0 100644 --- a/spec/project_spec.rb +++ b/spec/project_spec.rb @@ -258,7 +258,7 @@ dir = File.expand_path('../changelog', __dir__) - it 'will not have a directory' do + it 'does not have a directory' do expect(Dir["#{dir}/*"].none? { |path| File.directory?(path) }).to be(true) end diff --git a/spec/rubocop/cop/performance/count_spec.rb b/spec/rubocop/cop/performance/count_spec.rb index 2e6bf293b5..950f9f6a4b 100644 --- a/spec/rubocop/cop/performance/count_spec.rb +++ b/spec/rubocop/cop/performance/count_spec.rb @@ -182,11 +182,11 @@ def count(&block) end context 'properly parses non related code' do - it 'will not raise an error for Bundler.setup' do + it 'does not raise an error for Bundler.setup' do expect { inspect_source('Bundler.setup(:default, :development)') }.not_to raise_error end - it 'will not raise an error for RakeTask.new' do + it 'does not raise an error for RakeTask.new' do expect { inspect_source('RakeTask.new(:spec)') }.not_to raise_error end end