diff options
Diffstat (limited to 'spec/rubocop/cop/code_reuse')
-rw-r--r-- | spec/rubocop/cop/code_reuse/active_record_spec.rb | 16 | ||||
-rw-r--r-- | spec/rubocop/cop/code_reuse/finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/rubocop/cop/code_reuse/presenter_spec.rb | 4 | ||||
-rw-r--r-- | spec/rubocop/cop/code_reuse/serializer_spec.rb | 4 | ||||
-rw-r--r-- | spec/rubocop/cop/code_reuse/service_class_spec.rb | 4 | ||||
-rw-r--r-- | spec/rubocop/cop/code_reuse/worker_spec.rb | 6 |
6 files changed, 17 insertions, 21 deletions
diff --git a/spec/rubocop/cop/code_reuse/active_record_spec.rb b/spec/rubocop/cop/code_reuse/active_record_spec.rb index 0f3d886e4b8..25eca185f26 100644 --- a/spec/rubocop/cop/code_reuse/active_record_spec.rb +++ b/spec/rubocop/cop/code_reuse/active_record_spec.rb @@ -1,11 +1,10 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' -require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/active_record' -describe RuboCop::Cop::CodeReuse::ActiveRecord do +RSpec.describe RuboCop::Cop::CodeReuse::ActiveRecord, type: :rubocop do include CopHelper subject(:cop) { described_class.new } @@ -46,7 +45,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do end it 'does not flag the use of ActiveRecord models in a model' do - path = Rails.root.join('app', 'models', 'foo.rb').to_s + path = rails_root_join('app', 'models', 'foo.rb').to_s expect_no_offenses(<<~SOURCE, path) def foo @@ -56,7 +55,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do end it 'does not flag the use of ActiveRecord models in a spec' do - path = Rails.root.join('spec', 'foo_spec.rb').to_s + path = rails_root_join('spec', 'foo_spec.rb').to_s expect_no_offenses(<<~SOURCE, path) def foo @@ -66,10 +65,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do end it 'does not flag the use of ActiveRecord models in a background migration' do - path = Rails - .root - .join('lib', 'gitlab', 'background_migration', 'foo.rb') - .to_s + path = rails_root_join('lib', 'gitlab', 'background_migration', 'foo.rb').to_s expect_no_offenses(<<~SOURCE, path) def foo @@ -79,7 +75,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do end it 'does not flag the use of ActiveRecord models in lib/gitlab/database' do - path = Rails.root.join('lib', 'gitlab', 'database', 'foo.rb').to_s + path = rails_root_join('lib', 'gitlab', 'database', 'foo.rb').to_s expect_no_offenses(<<~SOURCE, path) def foo diff --git a/spec/rubocop/cop/code_reuse/finder_spec.rb b/spec/rubocop/cop/code_reuse/finder_spec.rb index b04e053a4c3..1935d825b19 100644 --- a/spec/rubocop/cop/code_reuse/finder_spec.rb +++ b/spec/rubocop/cop/code_reuse/finder_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/finder' -describe RuboCop::Cop::CodeReuse::Finder do +RSpec.describe RuboCop::Cop::CodeReuse::Finder, type: :rubocop do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/presenter_spec.rb b/spec/rubocop/cop/code_reuse/presenter_spec.rb index 4fe72619273..1366018ec12 100644 --- a/spec/rubocop/cop/code_reuse/presenter_spec.rb +++ b/spec/rubocop/cop/code_reuse/presenter_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/presenter' -describe RuboCop::Cop::CodeReuse::Presenter do +RSpec.describe RuboCop::Cop::CodeReuse::Presenter, type: :rubocop do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/serializer_spec.rb b/spec/rubocop/cop/code_reuse/serializer_spec.rb index 4530b15eed7..d4341cc0367 100644 --- a/spec/rubocop/cop/code_reuse/serializer_spec.rb +++ b/spec/rubocop/cop/code_reuse/serializer_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/serializer' -describe RuboCop::Cop::CodeReuse::Serializer do +RSpec.describe RuboCop::Cop::CodeReuse::Serializer, type: :rubocop do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/service_class_spec.rb b/spec/rubocop/cop/code_reuse/service_class_spec.rb index 7b8d82f332e..b018e743230 100644 --- a/spec/rubocop/cop/code_reuse/service_class_spec.rb +++ b/spec/rubocop/cop/code_reuse/service_class_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/service_class' -describe RuboCop::Cop::CodeReuse::ServiceClass do +RSpec.describe RuboCop::Cop::CodeReuse::ServiceClass, type: :rubocop do include CopHelper subject(:cop) { described_class.new } diff --git a/spec/rubocop/cop/code_reuse/worker_spec.rb b/spec/rubocop/cop/code_reuse/worker_spec.rb index 97acaeb7643..1f502e554c4 100644 --- a/spec/rubocop/cop/code_reuse/worker_spec.rb +++ b/spec/rubocop/cop/code_reuse/worker_spec.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' require 'rubocop' require 'rubocop/rspec/support' require_relative '../../../../rubocop/cop/code_reuse/worker' -describe RuboCop::Cop::CodeReuse::Worker do +RSpec.describe RuboCop::Cop::CodeReuse::Worker, type: :rubocop do include CopHelper subject(:cop) { described_class.new } @@ -31,7 +31,7 @@ describe RuboCop::Cop::CodeReuse::Worker do .and_return(true) expect_offense(<<~SOURCE) - class Foo < Grape::API + class Foo < Grape::API::Instance resource :projects do get '/' do FooWorker.perform_async |