sevencop 0.44.0 → 0.45.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/config/default.yml +6 -0
- data/lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb +40 -0
- data/lib/sevencop/version.rb +1 -1
- data/lib/sevencop.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6397930dce89363902d194be1a0b259969d18fcf1224068130f9959178c77ff8
|
4
|
+
data.tar.gz: 51efafab1bd74a671469f4aca611d47892a9cefd3d862ce9795e444b57bbffca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 255171a35cbf105447f400f82e8ecce903a478a9b9dd3fff3e270ad9ee4b78a72c7f66502bfbae9c3d02d717a6787cc40d97a1f608c587563566b6d96f613a2d
|
7
|
+
data.tar.gz: 5a985d8e7ffd6fe1442f1f8992987618878bacbde3ea36137cb68d36340f66149d94653cd14e3bfe6640dc877eafbef34874514b59271d8ce58df7adfaf69dc4
|
data/.rubocop.yml
CHANGED
@@ -43,6 +43,7 @@ RSpec/SpecFilePathFormat:
|
|
43
43
|
RSpecExamplesInSameGroup: rspec_examples_in_same_group
|
44
44
|
RSpecMatcherConsistentParentheses: rspec_matcher_consistent_parentheses
|
45
45
|
RSpecMemoizedHelperBlockDelimiter: rspec_memoized_helper_block_delimiter
|
46
|
+
RSpecPendingOnlyExampleGroup: rspec_pending_only_example_group
|
46
47
|
RSpecRailsHaveHttpStatus: rspec_rails_have_http_status
|
47
48
|
RSpecRailsStatusCodeCheckBySubject: rspec_rails_status_code_check_by_subject
|
48
49
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -49,6 +49,7 @@ Note that all cops are `Enabled: false` by default.
|
|
49
49
|
- [Sevencop/RSpecExamplesInSameGroup](lib/rubocop/cop/sevencop/rspec_examples_in_same_group.rb)
|
50
50
|
- [Sevencop/RSpecMatcherConsistentParentheses](lib/rubocop/cop/sevencop/rspec_matcher_consistent_parentheses.rb)
|
51
51
|
- [Sevencop/RSpecMemoizedHelperBlockDelimiter](lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb)
|
52
|
+
- [Sevencop/RSpecPendingOnlyExampleGroup](lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb)
|
52
53
|
- [Sevencop/RSpecRailsHaveHttpStatus](lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb)
|
53
54
|
- [Sevencop/RSpecRailsStatusCodeCheckBySubject](lib/rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject.rb)
|
54
55
|
|
data/config/default.yml
CHANGED
@@ -142,6 +142,12 @@ Sevencop/RSpecMemoizedHelperBlockDelimiter:
|
|
142
142
|
Include:
|
143
143
|
- "**/spec/**/*.rb"
|
144
144
|
|
145
|
+
Sevencop/RSpecPendingOnlyExampleGroup:
|
146
|
+
Description: Remove pending-only test files.
|
147
|
+
Enabled: false
|
148
|
+
Include:
|
149
|
+
- "**/spec/**/*.rb"
|
150
|
+
|
145
151
|
Sevencop/RSpecRailsHaveHttpStatus:
|
146
152
|
Description: |
|
147
153
|
Always check status code with `have_http_status`.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Sevencop
|
6
|
+
# Remove pending-only test files.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# # bad
|
10
|
+
# RSpec.describe Post do
|
11
|
+
# pending "add some examples to (or delete) #{__FILE__}"
|
12
|
+
# end
|
13
|
+
class RSpecPendingOnlyExampleGroup < ::RuboCop::Cop::Base
|
14
|
+
MSG = 'Remove pending-only test files.'
|
15
|
+
|
16
|
+
RESTRICT_ON_SEND = %i[
|
17
|
+
describe
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
def on_send(node)
|
21
|
+
block_node = node.parent
|
22
|
+
return unless pending_only_example_group?(block_node)
|
23
|
+
|
24
|
+
add_offense(block_node)
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
# @!method pending_only_example_group?(node)
|
30
|
+
def_node_matcher :pending_only_example_group?, <<~PATTERN
|
31
|
+
(block
|
32
|
+
(send (const nil? :RSpec) :describe ...)
|
33
|
+
(args)
|
34
|
+
(send nil? :pending ...)
|
35
|
+
)
|
36
|
+
PATTERN
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/sevencop/version.rb
CHANGED
data/lib/sevencop.rb
CHANGED
@@ -25,5 +25,6 @@ require_relative 'rubocop/cop/sevencop/rspec_empty_line_after_let'
|
|
25
25
|
require_relative 'rubocop/cop/sevencop/rspec_examples_in_same_group'
|
26
26
|
require_relative 'rubocop/cop/sevencop/rspec_matcher_consistent_parentheses'
|
27
27
|
require_relative 'rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter'
|
28
|
+
require_relative 'rubocop/cop/sevencop/rspec_pending_only_example_group'
|
28
29
|
require_relative 'rubocop/cop/sevencop/rspec_rails_have_http_status'
|
29
30
|
require_relative 'rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sevencop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.45.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/rubocop/cop/sevencop/rspec_examples_in_same_group.rb
|
78
78
|
- lib/rubocop/cop/sevencop/rspec_matcher_consistent_parentheses.rb
|
79
79
|
- lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb
|
80
|
+
- lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb
|
80
81
|
- lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb
|
81
82
|
- lib/rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject.rb
|
82
83
|
- lib/sevencop.rb
|