summaryrefslogtreecommitdiff
path: root/spec/rubocop/cop/scalability/cron_worker_context_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubocop/cop/scalability/cron_worker_context_spec.rb')
-rw-r--r--spec/rubocop/cop/scalability/cron_worker_context_spec.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/rubocop/cop/scalability/cron_worker_context_spec.rb b/spec/rubocop/cop/scalability/cron_worker_context_spec.rb
index 460514d9bed..e917d33b1e5 100644
--- a/spec/rubocop/cop/scalability/cron_worker_context_spec.rb
+++ b/spec/rubocop/cop/scalability/cron_worker_context_spec.rb
@@ -2,17 +2,16 @@
require 'fast_spec_helper'
require 'rubocop'
-require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/cron_worker_context'
-describe RuboCop::Cop::Scalability::CronWorkerContext do
+describe RuboCop::Cop::Scalability::CronWorkerContext, type: :rubocop do
include CopHelper
include ExpectOffense
subject(:cop) { described_class.new }
it 'adds an offense when including CronjobQueue' do
- inspect_source(<<~CODE.strip_indent)
+ inspect_source(<<~CODE)
class SomeWorker
include CronjobQueue
end
@@ -22,14 +21,14 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
it 'does not add offenses for other workers' do
- expect_no_offenses(<<~CODE.strip_indent)
+ expect_no_offenses(<<~CODE)
class SomeWorker
end
CODE
end
it 'does not add an offense when the class defines a context' do
- expect_no_offenses(<<~CODE.strip_indent)
+ expect_no_offenses(<<~CODE)
class SomeWorker
include CronjobQueue
@@ -39,7 +38,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
it 'does not add an offense when the worker calls `with_context`' do
- expect_no_offenses(<<~CODE.strip_indent)
+ expect_no_offenses(<<~CODE)
class SomeWorker
include CronjobQueue
@@ -53,7 +52,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
it 'does not add an offense when the worker calls `bulk_perform_async_with_contexts`' do
- expect_no_offenses(<<~CODE.strip_indent)
+ expect_no_offenses(<<~CODE)
class SomeWorker
include CronjobQueue
@@ -67,7 +66,7 @@ describe RuboCop::Cop::Scalability::CronWorkerContext do
end
it 'does not add an offense when the worker calls `bulk_perform_in_with_contexts`' do
- expect_no_offenses(<<~CODE.strip_indent)
+ expect_no_offenses(<<~CODE)
class SomeWorker
include CronjobQueue