rubocop-rspec 2.13.1 → 2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7da4fe826259c4b6981fabc58abafd9d91d121a35b538f40953af7f152dca15
|
4
|
+
data.tar.gz: fd8a448c3534ad861e218b92d198d1ca0a6375f95dfc9fdf87cb4bbfe7fd956a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf56052d556e623c3b7ffd93eed6dd2931c59b869de859a9f58ff8408ae87ad87a576cd53ce351c759ced16434749b4e2d18f5bfc5547c124b81c7c17432014
|
7
|
+
data.tar.gz: 0134a9c72e903bf20e60a7e0ac16cee7d9e3846e7e65832b4950d5d9dca3292e76238e6c1382984c050a07d475978efdf65b54961de3a95b11a0833b4da5f00d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 2.13.2 (2022-09-23)
|
6
|
+
|
7
|
+
* Fix an error for `RSpec/Capybara/SpecificFinders` with no parentheses. ([@ydah][])
|
8
|
+
* Fix a false positive for `RSpec/NoExpectationExample` with pending using `skip` or `pending` inside an example. ([@ydah][])
|
9
|
+
* Exclude `have_text` and `have_content` that raise `ArgumentError` with `RSpec/Capybara/VisibilityMatcher` where `:visible` is an invalid option. ([@ydah][])
|
10
|
+
* Fix a false negative for `RSpec/Capybara/VisibilityMatcher` with negative matchers. ([@ydah][])
|
11
|
+
|
5
12
|
## 2.13.1 (2022-09-12)
|
6
13
|
|
7
14
|
* Include config/obsoletion.yml in the gemspec. ([@hosamaly][])
|
@@ -76,8 +76,15 @@ module RuboCop
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def offense_range(node)
|
79
|
-
range_between(node.loc.selector.begin_pos,
|
80
|
-
|
79
|
+
range_between(node.loc.selector.begin_pos, end_pos(node))
|
80
|
+
end
|
81
|
+
|
82
|
+
def end_pos(node)
|
83
|
+
if node.loc.end
|
84
|
+
node.loc.end.end_pos
|
85
|
+
else
|
86
|
+
node.loc.expression.end_pos
|
87
|
+
end
|
81
88
|
end
|
82
89
|
end
|
83
90
|
end
|
@@ -29,20 +29,20 @@ module RuboCop
|
|
29
29
|
class VisibilityMatcher < Base
|
30
30
|
MSG_FALSE = 'Use `:all` or `:hidden` instead of `false`.'
|
31
31
|
MSG_TRUE = 'Use `:visible` instead of `true`.'
|
32
|
-
CAPYBARA_MATCHER_METHODS = %
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
32
|
+
CAPYBARA_MATCHER_METHODS = %w[
|
33
|
+
button
|
34
|
+
checked_field
|
35
|
+
css
|
36
|
+
field
|
37
|
+
link
|
38
|
+
select
|
39
|
+
selector
|
40
|
+
table
|
41
|
+
unchecked_field
|
42
|
+
xpath
|
43
|
+
].flat_map do |element|
|
44
|
+
["have_#{element}".to_sym, "have_no_#{element}".to_sym]
|
45
|
+
end
|
46
46
|
|
47
47
|
RESTRICT_ON_SEND = CAPYBARA_MATCHER_METHODS
|
48
48
|
|
@@ -49,10 +49,18 @@ module RuboCop
|
|
49
49
|
send_pattern('#Expectations.all')
|
50
50
|
)
|
51
51
|
|
52
|
+
# @!method including_any_skip_example?(node)
|
53
|
+
# @param [RuboCop::AST::Node] node
|
54
|
+
# @return [Boolean]
|
55
|
+
def_node_search :including_any_skip_example?, <<~PATTERN
|
56
|
+
(send nil? {:pending :skip} ...)
|
57
|
+
PATTERN
|
58
|
+
|
52
59
|
# @param [RuboCop::AST::BlockNode] node
|
53
60
|
def on_block(node)
|
54
61
|
return unless regular_or_focused_example?(node)
|
55
62
|
return if including_any_expectation?(node)
|
63
|
+
return if including_any_skip_example?(node)
|
56
64
|
|
57
65
|
add_offense(node)
|
58
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.
|
4
|
+
version: 2.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Backus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-09-
|
13
|
+
date: 2022-09-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rubocop
|