debian-mirror-gitlab/spec/rubocop/cop/include_sidekiq_worker_spec.rb
2022-10-11 01:57:18 +05:30

20 lines
550 B
Ruby

# frozen_string_literal: true
require 'rubocop_spec_helper'
require_relative '../../../rubocop/cop/include_sidekiq_worker'
RSpec.describe RuboCop::Cop::IncludeSidekiqWorker do
context 'when `Sidekiq::Worker` is included' do
it 'registers an offense and corrects', :aggregate_failures do
expect_offense(<<~CODE)
include Sidekiq::Worker
^^^^^^^^^^^^^^^ Include `ApplicationWorker`, not `Sidekiq::Worker`.
CODE
expect_correction(<<~CODE)
include ApplicationWorker
CODE
end
end
end