Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
69dbc5a5
Commit
69dbc5a5
authored
Aug 28, 2019
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Rubocop::SpecHelper file
parent
0fee9447
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
37 deletions
+0
-37
rubocop/cop/rspec/be_success_matcher.rb
rubocop/cop/rspec/be_success_matcher.rb
+0
-4
rubocop/spec_helpers.rb
rubocop/spec_helpers.rb
+0
-30
spec/rubocop/cop/rspec/be_success_matcher_spec.rb
spec/rubocop/cop/rspec/be_success_matcher_spec.rb
+0
-3
No files found.
rubocop/cop/rspec/be_success_matcher.rb
View file @
69dbc5a5
# 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
...
...
rubocop/spec_helpers.rb
deleted
100644 → 0
View file @
0fee9447
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
spec/rubocop/cop/rspec/be_success_matcher_spec.rb
View file @
69dbc5a5
...
...
@@ -2,9 +2,6 @@
require
'spec_helper'
require
'rubocop'
require
'rubocop/rspec/support'
require_relative
'../../../../rubocop/cop/rspec/be_success_matcher'
describe
RuboCop
::
Cop
::
RSpec
::
BeSuccessMatcher
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment