summaryrefslogtreecommitdiff
path: root/rubocop
diff options
context:
space:
mode:
authorVitali Tatarintev <vtatarintev@gitlab.com>2019-08-28 08:48:14 +0200
committerVitali Tatarintev <vtatarintev@gitlab.com>2019-08-28 08:48:14 +0200
commit69dbc5a5270a2b00bc2e359af37d6176748db400 (patch)
tree2e6efffb72d02afd8db11f101ae89d48c2c9c5b3 /rubocop
parent0fee944741ab24071417230d0acc5dbc93e96a0b (diff)
downloadgitlab-ce-69dbc5a5270a2b00bc2e359af37d6176748db400.tar.gz
Remove Rubocop::SpecHelper file
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/cop/rspec/be_success_matcher.rb4
-rw-r--r--rubocop/spec_helpers.rb30
2 files changed, 0 insertions, 34 deletions
diff --git a/rubocop/cop/rspec/be_success_matcher.rb b/rubocop/cop/rspec/be_success_matcher.rb
index 07dad061613..dce9604b3d7 100644
--- a/rubocop/cop/rspec/be_success_matcher.rb
+++ b/rubocop/cop/rspec/be_success_matcher.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require_relative '../../spec_helpers'
-
module RuboCop
module Cop
module RSpec
@@ -24,8 +22,6 @@ module RuboCop
# it { is_expected.to be_successful }
#
class BeSuccessMatcher < RuboCop::Cop::Cop
- include SpecHelpers
-
MESSAGE = 'Do not use deprecated `success?` method, use `successful?` instead.'
def_node_search :expect_to_be_success?, <<~PATTERN
diff --git a/rubocop/spec_helpers.rb b/rubocop/spec_helpers.rb
deleted file mode 100644
index ecd77c4351d..00000000000
--- a/rubocop/spec_helpers.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-module RuboCop
- module SpecHelpers
- SPEC_HELPERS = %w[fast_spec_helper.rb rails_helper.rb spec_helper.rb].freeze
- MIGRATION_SPEC_DIRECTORIES = ['spec/migrations', 'spec/lib/gitlab/background_migration'].freeze
-
- # Returns true if the given node originated from the spec directory.
- def in_spec?(node)
- path = node.location.expression.source_buffer.name
- pwd = RuboCop::PathUtil.pwd
-
- !SPEC_HELPERS.include?(File.basename(path)) &&
- path.start_with?(File.join(pwd, 'spec'), File.join(pwd, 'ee', 'spec'))
- end
-
- def migration_directories
- @migration_directories ||= MIGRATION_SPEC_DIRECTORIES.map do |dir|
- pwd = RuboCop::PathUtil.pwd
- [File.join(pwd, dir), File.join(pwd, 'ee', dir)]
- end.flatten
- end
-
- # Returns true if the given node originated from a migration spec.
- def in_migration_spec?(node)
- path = node.location.expression.source_buffer.name
-
- in_spec?(node) &&
- path.start_with?(*migration_directories)
- end
- end
-end