Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop/scalability/idempotent_worker_spec.rb')
-rw-r--r--spec/rubocop/cop/scalability/idempotent_worker_spec.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/rubocop/cop/scalability/idempotent_worker_spec.rb b/spec/rubocop/cop/scalability/idempotent_worker_spec.rb
index 666122a9de4..729f2613697 100644
--- a/spec/rubocop/cop/scalability/idempotent_worker_spec.rb
+++ b/spec/rubocop/cop/scalability/idempotent_worker_spec.rb
@@ -5,8 +5,6 @@ require 'rubocop'
require_relative '../../../../rubocop/cop/scalability/idempotent_worker'
RSpec.describe RuboCop::Cop::Scalability::IdempotentWorker do
- include CopHelper
-
subject(:cop) { described_class.new }
before do
@@ -16,21 +14,18 @@ RSpec.describe RuboCop::Cop::Scalability::IdempotentWorker do
end
it 'adds an offense when not defining idempotent method' do
- inspect_source(<<~CODE)
+ expect_offense(<<~CODE)
class SomeWorker
+ ^^^^^^^^^^^^^^^^ Avoid adding not idempotent workers.[...]
end
CODE
-
- expect(cop.offenses.size).to eq(1)
end
it 'adds an offense when not defining idempotent method' do
- inspect_source(<<~CODE)
+ expect_no_offenses(<<~CODE)
class SomeWorker
idempotent!
end
CODE
-
- expect(cop.offenses.size).to be_zero
end
end