Commit df71d756 authored by James Fargher's avatar James Fargher

Merge branch 'include_expect_offense_rubocop_type_specs' into 'master'

Include ExpectOffense module in :rubocop specs

See merge request gitlab-org/gitlab!34491
parents a1fc9259 d04dcd81
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require 'rubocop/rspec/support' require 'rubocop/rspec/support'
require_relative '../../../rubocop/cop/filename_length' require_relative '../../../rubocop/cop/filename_length'
require_relative '../../support/helpers/expect_offense'
describe RuboCop::Cop::FilenameLength do describe RuboCop::Cop::FilenameLength, type: :rubocop do
subject(:cop) { described_class.new } subject(:cop) { described_class.new }
it 'does not flag files with names 100 characters long' do it 'does not flag files with names 100 characters long' do
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/performance/ar_count_each.rb' require_relative '../../../../rubocop/cop/performance/ar_count_each.rb'
describe RuboCop::Cop::Performance::ARCountEach do describe RuboCop::Cop::Performance::ARCountEach, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank.rb' require_relative '../../../../rubocop/cop/performance/ar_exists_and_present_blank.rb'
describe RuboCop::Cop::Performance::ARExistsAndPresentBlank do describe RuboCop::Cop::Performance::ARExistsAndPresentBlank, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'fast_spec_helper'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/performance/readlines_each' require_relative '../../../../rubocop/cop/performance/readlines_each'
describe RuboCop::Cop::Performance::ReadlinesEach do describe RuboCop::Cop::Performance::ReadlinesEach, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/rspec/modify_sidekiq_middleware' require_relative '../../../../rubocop/cop/rspec/modify_sidekiq_middleware'
describe RuboCop::Cop::RSpec::ModifySidekiqMiddleware do describe RuboCop::Cop::RSpec::ModifySidekiqMiddleware, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/bulk_perform_with_context' require_relative '../../../../rubocop/cop/scalability/bulk_perform_with_context'
describe RuboCop::Cop::Scalability::BulkPerformWithContext do describe RuboCop::Cop::Scalability::BulkPerformWithContext, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/cron_worker_context' 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 CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/file_uploads' require_relative '../../../../rubocop/cop/scalability/file_uploads'
describe RuboCop::Cop::Scalability::FileUploads do describe RuboCop::Cop::Scalability::FileUploads, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -2,10 +2,9 @@ ...@@ -2,10 +2,9 @@
require 'fast_spec_helper' require 'fast_spec_helper'
require 'rubocop' require 'rubocop'
require_relative '../../../support/helpers/expect_offense'
require_relative '../../../../rubocop/cop/scalability/idempotent_worker' require_relative '../../../../rubocop/cop/scalability/idempotent_worker'
describe RuboCop::Cop::Scalability::IdempotentWorker do describe RuboCop::Cop::Scalability::IdempotentWorker, type: :rubocop do
include CopHelper include CopHelper
include ExpectOffense include ExpectOffense
......
...@@ -4,6 +4,7 @@ require_relative "helpers/stub_configuration" ...@@ -4,6 +4,7 @@ require_relative "helpers/stub_configuration"
require_relative "helpers/stub_metrics" require_relative "helpers/stub_metrics"
require_relative "helpers/stub_object_storage" require_relative "helpers/stub_object_storage"
require_relative "helpers/stub_env" require_relative "helpers/stub_env"
require_relative "helpers/expect_offense"
RSpec.configure do |config| RSpec.configure do |config|
config.mock_with :rspec config.mock_with :rspec
...@@ -13,4 +14,6 @@ RSpec.configure do |config| ...@@ -13,4 +14,6 @@ RSpec.configure do |config|
config.include StubMetrics config.include StubMetrics
config.include StubObjectStorage config.include StubObjectStorage
config.include StubENV config.include StubENV
config.include ExpectOffense, type: :rubocop
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment