blob: 8c706925ab930b6c8ea9704f71c7e43569cc692b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
require 'fast_spec_helper'
require_relative '../../../rubocop/cop/include_sidekiq_worker'
RSpec.describe RuboCop::Cop::IncludeSidekiqWorker do
subject(:cop) { described_class.new }
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
|