Skip to content

Commit b9f852b

Browse files
committed
Use RuboCop RSpec 2.16
This commit suppresses the following offenses: ```console % bundle exec rubocop (snip) Offenses: spec/rubocop/cop/rails/application_job_spec.rb:3:62: C: [Correctable] RSpec/DuplicatedMetadata: Avoid duplicated metadata. RSpec.describe RuboCop::Cop::Rails::ApplicationJob, :config, :config do ^^^^^^^ spec/rubocop/cop/rails/application_mailer_spec.rb:3:65: C: [Correctable] RSpec/DuplicatedMetadata: Avoid duplicated metadata. RSpec.describe RuboCop::Cop::Rails::ApplicationMailer, :config, :config do ^^^^^^^ spec/rubocop/cop/rails/application_record_spec.rb:3:65: C: [Correctable] RSpec/DuplicatedMetadata: Avoid duplicated metadata. RSpec.describe RuboCop::Cop::Rails::ApplicationRecord, :config, :config do ^^^^^^^ spec/rubocop/cop/rails/http_positional_arguments_spec.rb:3:71: C: [Correctable] RSpec/DuplicatedMetadata: Avoid duplicated metadata. RSpec.describe RuboCop::Cop::Rails::HttpPositionalArguments, :config, :config do ^^^^^^^ spec/rubocop/cop/rails/redundant_presence_validation_on_belongs_to_spec.rb:191:7: C: RSpec/PendingWithoutReason: Give the reason for pending. pending 'registers an offense even when the presence option is factored out' do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/rubocop/cop/rails/redundant_presence_validation_on_belongs_to_spec.rb:201:7: C: RSpec/PendingWithoutReason: Give the reason for pending. pending 'registers an offense for non-absence option' do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/rubocop/cop/rails/redundant_presence_validation_on_belongs_to_spec.rb:213:7: C: RSpec/PendingWithoutReason: Give the reason for pending. pending 'registers an offense when validation key is a string' do ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 277 files inspected, 7 offenses detected, 4 offenses autocorrectable ```
1 parent f8153ca commit b9f852b

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
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.15.0'
14+
gem 'rubocop-rspec', '~> 2.16.0'
1515
gem 'simplecov'
1616
gem 'test-queue'
1717
gem 'yard', '~> 0.9'

spec/rubocop/cop/rails/application_job_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe RuboCop::Cop::Rails::ApplicationJob, :config, :config do
3+
RSpec.describe RuboCop::Cop::Rails::ApplicationJob, :config do
44
context 'Rails 4.2', :rails42 do
55
it 'allows ApplicationJob to be defined' do
66
expect_no_offenses(<<~RUBY)

spec/rubocop/cop/rails/application_mailer_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe RuboCop::Cop::Rails::ApplicationMailer, :config, :config do
3+
RSpec.describe RuboCop::Cop::Rails::ApplicationMailer, :config do
44
context 'Rails 4.2', :rails42 do
55
it 'allows `ApplicationMailer` to be defined' do
66
expect_no_offenses(<<~RUBY)

spec/rubocop/cop/rails/application_record_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe RuboCop::Cop::Rails::ApplicationRecord, :config, :config do
3+
RSpec.describe RuboCop::Cop::Rails::ApplicationRecord, :config do
44
context 'Rails 4.2', :rails42 do
55
it 'allows ApplicationRecord to be defined' do
66
expect_no_offenses(<<~RUBY)

spec/rubocop/cop/rails/http_positional_arguments_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe RuboCop::Cop::Rails::HttpPositionalArguments, :config, :config do
3+
RSpec.describe RuboCop::Cop::Rails::HttpPositionalArguments, :config do
44
context 'Rails 4.2', :rails42 do
55
it 'does not register an offense for get method' do
66
expect_no_offenses('get :create, user_id: @user.id')

spec/rubocop/cop/rails/redundant_presence_validation_on_belongs_to_spec.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ class Profile
188188
RUBY
189189
end
190190

191-
pending 'registers an offense even when the presence option is factored out' do
191+
it 'registers an offense even when the presence option is factored out' do
192+
pending 'Not yet implemented.'
193+
192194
expect_offense(<<~RUBY)
193195
belongs_to :user
194196
with_options presence: true do
@@ -198,7 +200,9 @@ class Profile
198200
RUBY
199201
end
200202

201-
pending 'registers an offense for non-absence option' do
203+
it 'registers an offense for non-absence option' do
204+
pending 'Not yet implemented.'
205+
202206
expect_offense(<<~RUBY)
203207
belongs_to :user
204208
validates :user, absence: false
@@ -210,7 +214,9 @@ class Profile
210214
RUBY
211215
end
212216

213-
pending 'registers an offense when validation key is a string' do
217+
it 'registers an offense when validation key is a string' do
218+
pending 'Not yet implemented.'
219+
214220
expect_offense(<<~RUBY)
215221
belongs_to :user
216222
validates 'user', presence: true

0 commit comments

Comments
 (0)