Browse Source

Autofix Rubocop Lint/AmbiguousOperator (#23680)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
6d42820e5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 15 deletions
  1. +0
    -8
      .rubocop_todo.yml
  2. +1
    -1
      spec/controllers/api/v1/suggestions_controller_spec.rb
  3. +4
    -4
      spec/lib/request_spec.rb
  4. +2
    -2
      spec/models/user_role_spec.rb

+ 0
- 8
.rubocop_todo.yml View File

@ -183,14 +183,6 @@ Lint/AmbiguousBlockAssociation:
- 'spec/services/unsuspend_account_service_spec.rb'
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperator:
Exclude:
- 'spec/controllers/api/v1/suggestions_controller_spec.rb'
- 'spec/lib/request_spec.rb'
- 'spec/models/user_role_spec.rb'
# Offense count: 17
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperatorPrecedence:

+ 1
- 1
spec/controllers/api/v1/suggestions_controller_spec.rb View File

@ -29,7 +29,7 @@ RSpec.describe Api::V1::SuggestionsController, type: :controller do
json = body_as_json
expect(json.size).to be >= 1
expect(json.map { |i| i[:id] }).to include *[bob, jeff].map { |i| i.id.to_s }
expect(json.map { |i| i[:id] }).to include class="p">(*[bob, jeff].map { |i| i.id.to_s })
end
end
end

+ 4
- 4
spec/lib/request_spec.rb View File

@ -43,7 +43,7 @@ describe Request do
before { stub_request(:get, 'http://example.com') }
it 'executes a HTTP request' do
expect { |block| subject.perform &block }.to yield_control
expect { |block| subject.perform class="p">(&block) }.to yield_control
expect(a_request(:get, 'http://example.com')).to have_been_made.once
end
@ -54,18 +54,18 @@ describe Request do
allow(resolver).to receive(:timeouts=).and_return(nil)
allow(Resolv::DNS).to receive(:open).and_yield(resolver)
expect { |block| subject.perform &block }.to yield_control
expect { |block| subject.perform class="p">(&block) }.to yield_control
expect(a_request(:get, 'http://example.com')).to have_been_made.once
end
it 'sets headers' do
expect { |block| subject.perform &block }.to yield_control
expect { |block| subject.perform class="p">(&block) }.to yield_control
expect(a_request(:get, 'http://example.com').with(headers: subject.headers)).to have_been_made
end
it 'closes underlying connection' do
expect_any_instance_of(HTTP::Client).to receive(:close)
expect { |block| subject.perform &block }.to yield_control
expect { |block| subject.perform class="p">(&block) }.to yield_control
end
it 'returns response which implements body_with_limit' do

+ 2
- 2
spec/models/user_role_spec.rb View File

@ -139,7 +139,7 @@ RSpec.describe UserRole, type: :model do
end
it 'has negative position' do
expect(subject.position).to eq -1
expect(subject.position).to eq class="p">(-1)
end
end
@ -159,7 +159,7 @@ RSpec.describe UserRole, type: :model do
end
it 'has negative position' do
expect(subject.position).to eq -1
expect(subject.position).to eq class="p">(-1)
end
end

Loading…
Cancel
Save