diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/rubocop/cop/sidekiq_options_queue_spec.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) | |
download | gitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/rubocop/cop/sidekiq_options_queue_spec.rb')
-rw-r--r-- | spec/rubocop/cop/sidekiq_options_queue_spec.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/spec/rubocop/cop/sidekiq_options_queue_spec.rb b/spec/rubocop/cop/sidekiq_options_queue_spec.rb index 306cbcf62b5..346a8d82475 100644 --- a/spec/rubocop/cop/sidekiq_options_queue_spec.rb +++ b/spec/rubocop/cop/sidekiq_options_queue_spec.rb @@ -2,29 +2,19 @@ require 'fast_spec_helper' -require 'rubocop' -require 'rubocop/rspec/support' - require_relative '../../../rubocop/cop/sidekiq_options_queue' RSpec.describe RuboCop::Cop::SidekiqOptionsQueue do - include CopHelper - subject(:cop) { described_class.new } it 'registers an offense when `sidekiq_options` is used with the `queue` option' do - inspect_source('sidekiq_options queue: "some_queue"') - - aggregate_failures do - expect(cop.offenses.size).to eq(1) - expect(cop.offenses.map(&:line)).to eq([1]) - expect(cop.highlights).to eq(['queue: "some_queue"']) - end + expect_offense(<<~CODE) + sidekiq_options queue: "some_queue" + ^^^^^^^^^^^^^^^^^^^ Do not manually set a queue; `ApplicationWorker` sets one automatically. + CODE end it 'does not register an offense when `sidekiq_options` is used with another option' do - inspect_source('sidekiq_options retry: false') - - expect(cop.offenses).to be_empty + expect_no_offenses('sidekiq_options retry: false') end end |