optimistic-json 0.1.2 → 0.1.3

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +6 -0
  4. data/Rakefile +5 -1
  5. data/lib/optimistic/json/parser.rb +28 -7
  6. data/lib/optimistic/json/version.rb +2 -1
  7. data/lib/optimistic/json.rb +1 -0
  8. data/sorbet/config +4 -0
  9. data/sorbet/rbi/annotations/.gitattributes +1 -0
  10. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  11. data/sorbet/rbi/gems/.gitattributes +1 -0
  12. data/sorbet/rbi/gems/ast@2.4.2.rbi +550 -0
  13. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  14. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1068 -0
  15. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  16. data/sorbet/rbi/gems/gem-release@2.2.2.rbi +1335 -0
  17. data/sorbet/rbi/gems/io-console@0.6.0.rbi +9 -0
  18. data/sorbet/rbi/gems/json@2.7.0.rbi +1797 -0
  19. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +12986 -0
  20. data/sorbet/rbi/gems/logger@1.6.0.rbi +845 -0
  21. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +218 -0
  22. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  23. data/sorbet/rbi/gems/parallel@1.28.0.rbi +270 -0
  24. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +5154 -0
  25. data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
  26. data/sorbet/rbi/gems/psych@5.1.1.1.rbi +2321 -0
  27. data/sorbet/rbi/gems/racc@1.7.3.rbi +169 -0
  28. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  29. data/sorbet/rbi/gems/rake@13.1.0.rbi +3025 -0
  30. data/sorbet/rbi/gems/rbi@0.3.11.rbi +5505 -0
  31. data/sorbet/rbi/gems/rbs@4.0.2.rbi +6908 -0
  32. data/sorbet/rbi/gems/rdoc@6.6.0.rbi +9 -0
  33. data/sorbet/rbi/gems/regexp_parser@2.8.2.rbi +3268 -0
  34. data/sorbet/rbi/gems/reline@0.4.1.rbi +9 -0
  35. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  36. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4798 -0
  37. data/sorbet/rbi/gems/rspec-core@3.12.2.rbi +9405 -0
  38. data/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi +6013 -0
  39. data/sorbet/rbi/gems/rspec-mocks@3.12.6.rbi +4750 -0
  40. data/sorbet/rbi/gems/rspec-support@3.12.1.rbi +1261 -0
  41. data/sorbet/rbi/gems/rspec@3.12.0.rbi +15 -0
  42. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +6750 -0
  43. data/sorbet/rbi/gems/rubocop-capybara@2.19.0.rbi +1058 -0
  44. data/sorbet/rbi/gems/rubocop-factory_bot@2.24.0.rbi +875 -0
  45. data/sorbet/rbi/gems/rubocop-rspec@2.25.0.rbi +7696 -0
  46. data/sorbet/rbi/gems/rubocop@1.58.0.rbi +53790 -0
  47. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  48. data/sorbet/rbi/gems/rubydex@0.2.3.rbi +787 -0
  49. data/sorbet/rbi/gems/spoom@1.7.14.rbi +6151 -0
  50. data/sorbet/rbi/gems/stringio@3.1.0.rbi +9 -0
  51. data/sorbet/rbi/gems/tapioca@0.19.1.rbi +3558 -0
  52. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  53. data/sorbet/rbi/gems/tsort@0.2.0.rbi +387 -0
  54. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +64 -0
  55. data/sorbet/tapioca/config.yml +13 -0
  56. data/sorbet/tapioca/require.rb +4 -0
  57. metadata +54 -22
  58. data/sig/optimistic/json.rbs +0 -6
@@ -0,0 +1,1058 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rubocop-capybara` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rubocop-capybara`.
6
+
7
+
8
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:3
9
+ module RuboCop; end
10
+
11
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:4
12
+ module RuboCop::Cop; end
13
+
14
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:5
15
+ module RuboCop::Cop::Capybara; end
16
+
17
+ # Help methods for capybara.
18
+ # @api private
19
+ #
20
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:8
21
+ module RuboCop::Cop::Capybara::CapybaraHelp
22
+ private
23
+
24
+ # @param selector [String]
25
+ # @return [Boolean]
26
+ # @example
27
+ # common_attributes?('a[focused]') # => true
28
+ # common_attributes?('button[focused][visible]') # => true
29
+ # common_attributes?('table[id=some-id]') # => true
30
+ # common_attributes?('h1[invalid]') # => false
31
+ #
32
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:61
33
+ def common_attributes?(selector); end
34
+
35
+ # @param node [RuboCop::AST::SendNode]
36
+ # @param option [Symbol]
37
+ # @return [Boolean]
38
+ #
39
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:125
40
+ def include_option?(node, option); end
41
+
42
+ # @param attrs [Array<String>]
43
+ # @return [Boolean]
44
+ # @example
45
+ # replaceable_attributes?('table[id=some-id]') # => true
46
+ # replaceable_attributes?('a[focused]') # => false
47
+ #
48
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:70
49
+ def replaceable_attributes?(attrs); end
50
+
51
+ # @param node [RuboCop::AST::SendNode]
52
+ # @param element [String]
53
+ # @param attrs [Array<String>]
54
+ # @return [Boolean]
55
+ #
56
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:108
57
+ def replaceable_element?(node, element, attrs); end
58
+
59
+ # @param node [RuboCop::AST::SendNode]
60
+ # @param locator [String]
61
+ # @param element [String]
62
+ # @return [Boolean]
63
+ #
64
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:45
65
+ def replaceable_option?(node, locator, element); end
66
+
67
+ # @param pseudo_class [String]
68
+ # @param locator [String]
69
+ # @return [Boolean]
70
+ #
71
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:85
72
+ def replaceable_pseudo_class?(pseudo_class, locator); end
73
+
74
+ # @param locator [String]
75
+ # @return [Boolean]
76
+ #
77
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:96
78
+ def replaceable_pseudo_class_not?(locator); end
79
+
80
+ # @param locator [String]
81
+ # @return [Boolean]
82
+ #
83
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:76
84
+ def replaceable_pseudo_classes?(locator); end
85
+
86
+ # @param node [RuboCop::AST::SendNode]
87
+ # @param attrs [Array<String>]
88
+ # @return [Boolean]
89
+ #
90
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:118
91
+ def replaceable_to_link?(node, attrs); end
92
+
93
+ class << self
94
+ # @param selector [String]
95
+ # @return [Boolean]
96
+ # @example
97
+ # common_attributes?('a[focused]') # => true
98
+ # common_attributes?('button[focused][visible]') # => true
99
+ # common_attributes?('table[id=some-id]') # => true
100
+ # common_attributes?('h1[invalid]') # => false
101
+ #
102
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:61
103
+ def common_attributes?(selector); end
104
+
105
+ # @param node [RuboCop::AST::SendNode]
106
+ # @param option [Symbol]
107
+ # @return [Boolean]
108
+ #
109
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:125
110
+ def include_option?(node, option); end
111
+
112
+ # @param attrs [Array<String>]
113
+ # @return [Boolean]
114
+ # @example
115
+ # replaceable_attributes?('table[id=some-id]') # => true
116
+ # replaceable_attributes?('a[focused]') # => false
117
+ #
118
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:70
119
+ def replaceable_attributes?(attrs); end
120
+
121
+ # @param node [RuboCop::AST::SendNode]
122
+ # @param element [String]
123
+ # @param attrs [Array<String>]
124
+ # @return [Boolean]
125
+ #
126
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:108
127
+ def replaceable_element?(node, element, attrs); end
128
+
129
+ # @param node [RuboCop::AST::SendNode]
130
+ # @param locator [String]
131
+ # @param element [String]
132
+ # @return [Boolean]
133
+ #
134
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:45
135
+ def replaceable_option?(node, locator, element); end
136
+
137
+ # @param pseudo_class [String]
138
+ # @param locator [String]
139
+ # @return [Boolean]
140
+ #
141
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:85
142
+ def replaceable_pseudo_class?(pseudo_class, locator); end
143
+
144
+ # @param locator [String]
145
+ # @return [Boolean]
146
+ #
147
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:96
148
+ def replaceable_pseudo_class_not?(locator); end
149
+
150
+ # @param locator [String]
151
+ # @return [Boolean]
152
+ #
153
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:76
154
+ def replaceable_pseudo_classes?(locator); end
155
+
156
+ # @param node [RuboCop::AST::SendNode]
157
+ # @param attrs [Array<String>]
158
+ # @return [Boolean]
159
+ #
160
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:118
161
+ def replaceable_to_link?(node, attrs); end
162
+ end
163
+ end
164
+
165
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:9
166
+ RuboCop::Cop::Capybara::CapybaraHelp::COMMON_OPTIONS = T.let(T.unsafe(nil), Array)
167
+
168
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:12
169
+ RuboCop::Cop::Capybara::CapybaraHelp::SPECIFIC_OPTIONS = T.let(T.unsafe(nil), Hash)
170
+
171
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/capybara_help.rb:35
172
+ RuboCop::Cop::Capybara::CapybaraHelp::SPECIFIC_PSEUDO_CLASSES = T.let(T.unsafe(nil), Array)
173
+
174
+ # Checks for click button or link style.
175
+ #
176
+ # @example EnforcedStyle: strict (default)
177
+ # # bad
178
+ # click_link_or_button('foo')
179
+ # click_on('foo')
180
+ #
181
+ # # good
182
+ # click_link('foo')
183
+ # click_button('foo')
184
+ #
185
+ # @example EnforcedStyle: link_or_button
186
+ # # bad
187
+ # click_link('foo')
188
+ # click_button('foo')
189
+ #
190
+ # # good
191
+ # click_link_or_button('foo')
192
+ # click_on('foo')
193
+ #
194
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:26
195
+ class RuboCop::Cop::Capybara::ClickLinkOrButtonStyle < ::RuboCop::Cop::Base
196
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
197
+
198
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:37
199
+ def on_send(node); end
200
+
201
+ private
202
+
203
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:62
204
+ def link_or_button_method?(node); end
205
+
206
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:45
207
+ def offense?(node); end
208
+
209
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:50
210
+ def offense_message(node); end
211
+
212
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:58
213
+ def strict_method?(node); end
214
+ end
215
+
216
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:34
217
+ RuboCop::Cop::Capybara::ClickLinkOrButtonStyle::CLICK_LINK_OR_BUTTON = T.let(T.unsafe(nil), Array)
218
+
219
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:31
220
+ RuboCop::Cop::Capybara::ClickLinkOrButtonStyle::MSG_CLICK_LINK_OR_BUTTON = T.let(T.unsafe(nil), String)
221
+
222
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:29
223
+ RuboCop::Cop::Capybara::ClickLinkOrButtonStyle::MSG_STRICT = T.let(T.unsafe(nil), String)
224
+
225
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:35
226
+ RuboCop::Cop::Capybara::ClickLinkOrButtonStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
227
+
228
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/click_link_or_button_style.rb:33
229
+ RuboCop::Cop::Capybara::ClickLinkOrButtonStyle::STRICT_METHODS = T.let(T.unsafe(nil), Array)
230
+
231
+ # Helps parsing css selector.
232
+ # @api private
233
+ #
234
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:8
235
+ module RuboCop::Cop::Capybara::CssSelector
236
+ private
237
+
238
+ # @param selector [String]
239
+ # @return [Boolean]
240
+ # @example
241
+ # attribute?('[attribute]') # => true
242
+ # attribute?('attribute') # => false
243
+ #
244
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:48
245
+ def attribute?(selector); end
246
+
247
+ # @param selector [String]
248
+ # @return [Array<String>]
249
+ # @example
250
+ # attributes('a[foo-bar_baz]') # => {"foo-bar_baz=>nil}
251
+ # attributes('button[foo][bar=baz]') # => {"foo"=>nil, "bar"=>"'baz'"}
252
+ # attributes('table[foo=bar]') # => {"foo"=>"'bar'"}
253
+ #
254
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:58
255
+ def attributes(selector); end
256
+
257
+ # @param selector [String]
258
+ # @return [Array<String>]
259
+ # @example
260
+ # classes('#some-id') # => []
261
+ # classes('.some-cls') # => ['some-cls']
262
+ # classes('#some-id.some-cls') # => ['some-cls']
263
+ # classes('#some-id.cls1.cls2') # => ['cls1', 'cls2']
264
+ #
265
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:39
266
+ def classes(selector); end
267
+
268
+ # @param selector [String]
269
+ # @return [String]
270
+ # @example
271
+ # id('#some-id') # => some-id
272
+ # id('.some-cls') # => nil
273
+ # id('#some-id.cls') # => some-id
274
+ #
275
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:17
276
+ def id(selector); end
277
+
278
+ # @param selector [String]
279
+ # @return [Boolean]
280
+ # @example
281
+ # id?('#some-id') # => true
282
+ # id?('.some-cls') # => false
283
+ #
284
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:28
285
+ def id?(selector); end
286
+
287
+ # @param selector [String]
288
+ # @return [Boolean]
289
+ # @example
290
+ # multiple_selectors?('a.cls b#id') # => true
291
+ # multiple_selectors?('a.cls') # => false
292
+ #
293
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:88
294
+ def multiple_selectors?(selector); end
295
+
296
+ # @param value [String]
297
+ # @return [Boolean, String]
298
+ # @example
299
+ # normalize_value('true') # => true
300
+ # normalize_value('false') # => false
301
+ # normalize_value(nil) # => nil
302
+ # normalize_value("foo") # => "'foo'"
303
+ #
304
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:100
305
+ def normalize_value(value); end
306
+
307
+ # @param selector [String]
308
+ # @return [Array<String>]
309
+ # @example
310
+ # pseudo_classes('button:not([disabled])') # => ['not()']
311
+ # pseudo_classes('a:enabled:not([valid])') # => ['enabled', 'not()']
312
+ #
313
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:74
314
+ def pseudo_classes(selector); end
315
+
316
+ class << self
317
+ # @param selector [String]
318
+ # @return [Boolean]
319
+ # @example
320
+ # attribute?('[attribute]') # => true
321
+ # attribute?('attribute') # => false
322
+ #
323
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:48
324
+ def attribute?(selector); end
325
+
326
+ # @param selector [String]
327
+ # @return [Array<String>]
328
+ # @example
329
+ # attributes('a[foo-bar_baz]') # => {"foo-bar_baz=>nil}
330
+ # attributes('button[foo][bar=baz]') # => {"foo"=>nil, "bar"=>"'baz'"}
331
+ # attributes('table[foo=bar]') # => {"foo"=>"'bar'"}
332
+ #
333
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:58
334
+ def attributes(selector); end
335
+
336
+ # @param selector [String]
337
+ # @return [Array<String>]
338
+ # @example
339
+ # classes('#some-id') # => []
340
+ # classes('.some-cls') # => ['some-cls']
341
+ # classes('#some-id.some-cls') # => ['some-cls']
342
+ # classes('#some-id.cls1.cls2') # => ['cls1', 'cls2']
343
+ #
344
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:39
345
+ def classes(selector); end
346
+
347
+ # @param selector [String]
348
+ # @return [String]
349
+ # @example
350
+ # id('#some-id') # => some-id
351
+ # id('.some-cls') # => nil
352
+ # id('#some-id.cls') # => some-id
353
+ #
354
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:17
355
+ def id(selector); end
356
+
357
+ # @param selector [String]
358
+ # @return [Boolean]
359
+ # @example
360
+ # id?('#some-id') # => true
361
+ # id?('.some-cls') # => false
362
+ #
363
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:28
364
+ def id?(selector); end
365
+
366
+ # @param selector [String]
367
+ # @return [Boolean]
368
+ # @example
369
+ # multiple_selectors?('a.cls b#id') # => true
370
+ # multiple_selectors?('a.cls') # => false
371
+ #
372
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:88
373
+ def multiple_selectors?(selector); end
374
+
375
+ # @param value [String]
376
+ # @return [Boolean, String]
377
+ # @example
378
+ # normalize_value('true') # => true
379
+ # normalize_value('false') # => false
380
+ # normalize_value(nil) # => nil
381
+ # normalize_value("foo") # => "'foo'"
382
+ #
383
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:100
384
+ def normalize_value(value); end
385
+
386
+ # @param selector [String]
387
+ # @return [Array<String>]
388
+ # @example
389
+ # pseudo_classes('button:not([disabled])') # => ['not()']
390
+ # pseudo_classes('a:enabled:not([valid])') # => ['enabled', 'not()']
391
+ #
392
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/mixin/css_selector.rb:74
393
+ def pseudo_classes(selector); end
394
+ end
395
+ end
396
+
397
+ # Checks that no expectations are set on Capybara's `current_path`.
398
+ #
399
+ # The
400
+ # https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher]
401
+ # should be used on `page` to set expectations on Capybara's
402
+ # current path, since it uses
403
+ # https://github.com/teamcapybara/capybara/blob/master/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality]
404
+ # which ensures that preceding actions (like `click_link`) have
405
+ # completed.
406
+ #
407
+ # This cop does not support autocorrection in some cases.
408
+ #
409
+ # @example
410
+ # # bad
411
+ # expect(current_path).to eq('/callback')
412
+ # expect(page.current_path).to eq('/callback')
413
+ #
414
+ # # good
415
+ # expect(page).to have_current_path('/callback', ignore_query: true)
416
+ #
417
+ # # bad (does not support autocorrection when `match` with a variable)
418
+ # expect(page).to match(variable)
419
+ #
420
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:29
421
+ class RuboCop::Cop::Capybara::CurrentPathExpectation < ::RuboCop::Cop::Base
422
+ include ::RuboCop::Cop::RangeHelp
423
+ extend ::RuboCop::Cop::AutoCorrector
424
+
425
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:46
426
+ def as_is_matcher(param0 = T.unsafe(nil)); end
427
+
428
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:40
429
+ def expectation_set_on_current_path(param0 = T.unsafe(nil)); end
430
+
431
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:63
432
+ def on_send(node); end
433
+
434
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:53
435
+ def regexp_node_matcher(param0 = T.unsafe(nil)); end
436
+
437
+ private
438
+
439
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:113
440
+ def add_argument_parentheses(corrector, arg_node); end
441
+
442
+ # `have_current_path` with no options will include the querystring
443
+ # while `page.current_path` does not.
444
+ # This ensures the option `ignore_query: true` is added
445
+ # except when `match` matcher.
446
+ #
447
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:131
448
+ def add_ignore_query_options(corrector, node, matcher_node); end
449
+
450
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:75
451
+ def autocorrect(corrector, node); end
452
+
453
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:99
454
+ def convert_regexp_node_to_literal(corrector, matcher_node, regexp_node); end
455
+
456
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:123
457
+ def method_call_with_no_parentheses?(arg_node); end
458
+
459
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:105
460
+ def regexp_node_to_regexp_expr(regexp_node); end
461
+
462
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:86
463
+ def rewrite_expectation(corrector, node, to_symbol, matcher_node); end
464
+
465
+ class << self
466
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:59
467
+ def autocorrect_incompatible_with; end
468
+ end
469
+ end
470
+
471
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:33
472
+ RuboCop::Cop::Capybara::CurrentPathExpectation::MSG = T.let(T.unsafe(nil), String)
473
+
474
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/current_path_expectation.rb:37
475
+ RuboCop::Cop::Capybara::CurrentPathExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
476
+
477
+ # Checks for usage of deprecated style methods.
478
+ #
479
+ # @example when using `assert_style`
480
+ # # bad
481
+ # page.find(:css, '#first').assert_style(display: 'block')
482
+ #
483
+ # # good
484
+ # page.find(:css, '#first').assert_matches_style(display: 'block')
485
+ #
486
+ # @example when using `has_style?`
487
+ # # bad
488
+ # expect(page.find(:css, 'first')
489
+ # .has_style?(display: 'block')).to be true
490
+ #
491
+ # # good
492
+ # expect(page.find(:css, 'first')
493
+ # .matches_style?(display: 'block')).to be true
494
+ #
495
+ # @example when using `have_style`
496
+ # # bad
497
+ # expect(page).to have_style(display: 'block')
498
+ #
499
+ # # good
500
+ # expect(page).to match_style(display: 'block')
501
+ #
502
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:31
503
+ class RuboCop::Cop::Capybara::MatchStyle < ::RuboCop::Cop::Base
504
+ extend ::RuboCop::Cop::AutoCorrector
505
+
506
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:42
507
+ def on_send(node); end
508
+
509
+ private
510
+
511
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:52
512
+ def message(node); end
513
+ end
514
+
515
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:34
516
+ RuboCop::Cop::Capybara::MatchStyle::MSG = T.let(T.unsafe(nil), String)
517
+
518
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:36
519
+ RuboCop::Cop::Capybara::MatchStyle::PREFERRED_METHOD = T.let(T.unsafe(nil), Hash)
520
+
521
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/match_style.rb:35
522
+ RuboCop::Cop::Capybara::MatchStyle::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
523
+
524
+ # Enforces use of `have_no_*` or `not_to` for negated expectations.
525
+ #
526
+ # @example EnforcedStyle: not_to (default)
527
+ # # bad
528
+ # expect(page).to have_no_selector
529
+ # expect(page).to have_no_css('a')
530
+ #
531
+ # # good
532
+ # expect(page).not_to have_selector
533
+ # expect(page).not_to have_css('a')
534
+ #
535
+ # @example EnforcedStyle: have_no
536
+ # # bad
537
+ # expect(page).not_to have_selector
538
+ # expect(page).not_to have_css('a')
539
+ #
540
+ # # good
541
+ # expect(page).to have_no_selector
542
+ # expect(page).to have_no_css('a')
543
+ #
544
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:26
545
+ class RuboCop::Cop::Capybara::NegationMatcher < ::RuboCop::Cop::Base
546
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
547
+ extend ::RuboCop::Cop::AutoCorrector
548
+
549
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:50
550
+ def have_no?(param0 = T.unsafe(nil)); end
551
+
552
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:44
553
+ def not_to?(param0 = T.unsafe(nil)); end
554
+
555
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:55
556
+ def on_send(node); end
557
+
558
+ private
559
+
560
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:78
561
+ def message(matcher); end
562
+
563
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:69
564
+ def offense?(node); end
565
+
566
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:74
567
+ def offense_range(node); end
568
+
569
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:93
570
+ def replaced_matcher(matcher); end
571
+
572
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:84
573
+ def replaced_runner; end
574
+ end
575
+
576
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:31
577
+ RuboCop::Cop::Capybara::NegationMatcher::CAPYBARA_MATCHERS = T.let(T.unsafe(nil), Array)
578
+
579
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:30
580
+ RuboCop::Cop::Capybara::NegationMatcher::MSG = T.let(T.unsafe(nil), String)
581
+
582
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:38
583
+ RuboCop::Cop::Capybara::NegationMatcher::NEGATIVE_MATCHERS = T.let(T.unsafe(nil), Set)
584
+
585
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:36
586
+ RuboCop::Cop::Capybara::NegationMatcher::POSITIVE_MATCHERS = T.let(T.unsafe(nil), Set)
587
+
588
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/negation_matcher.rb:41
589
+ RuboCop::Cop::Capybara::NegationMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)
590
+
591
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:6
592
+ module RuboCop::Cop::Capybara::RSpec; end
593
+
594
+ # A helper for `explicit` style
595
+ #
596
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:108
597
+ module RuboCop::Cop::Capybara::RSpec::ExplicitHelper
598
+ extend ::RuboCop::AST::NodePattern::Macros
599
+
600
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:138
601
+ def predicate_matcher?(param0 = T.unsafe(nil)); end
602
+
603
+ private
604
+
605
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:124
606
+ def allowed_explicit_matchers; end
607
+
608
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:128
609
+ def check_explicit(node); end
610
+
611
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:162
612
+ def corrector_explicit(corrector, to_node, actual, matcher); end
613
+
614
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:156
615
+ def message_explicit(matcher); end
616
+
617
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:169
618
+ def move_predicate(corrector, actual, matcher); end
619
+
620
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:149
621
+ def predicate_matcher_name?(name); end
622
+
623
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:180
624
+ def replacement_matcher(node); end
625
+
626
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:176
627
+ def to_predicate_method(matcher); end
628
+ end
629
+
630
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:113
631
+ RuboCop::Cop::Capybara::RSpec::ExplicitHelper::BUILT_IN_MATCHERS = T.let(T.unsafe(nil), Array)
632
+
633
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:118
634
+ RuboCop::Cop::Capybara::RSpec::ExplicitHelper::INFLECTED_MATCHER = T.let(T.unsafe(nil), Array)
635
+
636
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:111
637
+ RuboCop::Cop::Capybara::RSpec::ExplicitHelper::MSG_EXPLICIT = T.let(T.unsafe(nil), String)
638
+
639
+ # Use `have_css` or `have_xpath` instead of `have_selector`.
640
+ #
641
+ # @example
642
+ # # bad
643
+ # expect(foo).to have_selector(:css, 'bar')
644
+ #
645
+ # # good
646
+ # expect(foo).to have_css('bar')
647
+ #
648
+ # # bad
649
+ # expect(foo).to have_selector(:xpath, 'bar')
650
+ #
651
+ # # good
652
+ # expect(foo).to have_xpath('bar')
653
+ #
654
+ # @example DefaultSelector: css (default)
655
+ # # bad
656
+ # expect(foo).to have_selector('bar')
657
+ #
658
+ # # good
659
+ # expect(foo).to have_css('bar')
660
+ #
661
+ # @example DefaultSelector: xpath
662
+ # # bad
663
+ # expect(foo).to have_selector('bar')
664
+ #
665
+ # # good
666
+ # expect(foo).to have_xpath('bar')
667
+ #
668
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:36
669
+ class RuboCop::Cop::Capybara::RSpec::HaveSelector < ::RuboCop::Cop::Base
670
+ include ::RuboCop::Cop::RangeHelp
671
+ extend ::RuboCop::Cop::AutoCorrector
672
+
673
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:44
674
+ def on_send(node); end
675
+
676
+ private
677
+
678
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:80
679
+ def default_selector; end
680
+
681
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:65
682
+ def deletion_range(first_argument, second_argument); end
683
+
684
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:61
685
+ def message_typed(type); end
686
+
687
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:76
688
+ def message_untyped; end
689
+
690
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:52
691
+ def on_select_with_type(node, type); end
692
+
693
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:70
694
+ def on_select_without_type(node); end
695
+ end
696
+
697
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:40
698
+ RuboCop::Cop::Capybara::RSpec::HaveSelector::MSG = T.let(T.unsafe(nil), String)
699
+
700
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:41
701
+ RuboCop::Cop::Capybara::RSpec::HaveSelector::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
702
+
703
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/have_selector.rb:42
704
+ RuboCop::Cop::Capybara::RSpec::HaveSelector::SELECTORS = T.let(T.unsafe(nil), Array)
705
+
706
+ # A helper for `inflected` style
707
+ #
708
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:8
709
+ module RuboCop::Cop::Capybara::RSpec::InflectedHelper
710
+ extend ::RuboCop::AST::NodePattern::Macros
711
+
712
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:46
713
+ def be_bool?(param0 = T.unsafe(nil)); end
714
+
715
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:51
716
+ def be_boolthy?(param0 = T.unsafe(nil)); end
717
+
718
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:32
719
+ def predicate_in_actual?(param0 = T.unsafe(nil)); end
720
+
721
+ private
722
+
723
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:55
724
+ def boolean_matcher?(node); end
725
+
726
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:19
727
+ def check_inflected(node); end
728
+
729
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:67
730
+ def message_inflected(predicate); end
731
+
732
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:63
733
+ def predicate?(sym); end
734
+
735
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:77
736
+ def remove_predicate(corrector, predicate); end
737
+
738
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:85
739
+ def rewrite_matcher(corrector, predicate, matcher); end
740
+
741
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:73
742
+ def to_predicate_matcher(name); end
743
+
744
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:94
745
+ def true?(to_symbol, matcher); end
746
+ end
747
+
748
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:11
749
+ RuboCop::Cop::Capybara::RSpec::InflectedHelper::EXPLICIT_MATCHER = T.let(T.unsafe(nil), Array)
750
+
751
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:14
752
+ RuboCop::Cop::Capybara::RSpec::InflectedHelper::MSG_INFLECTED = T.let(T.unsafe(nil), String)
753
+
754
+ # Prefer using predicate matcher over using predicate method directly.
755
+ #
756
+ # Capybara defines magic matchers for predicate methods.
757
+ # This cop recommends to use the predicate matcher instead of using
758
+ # predicate method directly.
759
+ #
760
+ # @example Strict: true, EnforcedStyle: inflected (default)
761
+ # # bad
762
+ # expect(foo.matches_css?(bar: 'baz')).to be_truthy
763
+ # expect(foo.matches_selector?(bar: 'baz')).to be_truthy
764
+ # expect(foo.matches_style?(bar: 'baz')).to be_truthy
765
+ # expect(foo.matches_xpath?(bar: 'baz')).to be_truthy
766
+ #
767
+ # # good
768
+ # expect(foo).to match_css(bar: 'baz')
769
+ # expect(foo).to match_selector(bar: 'baz')
770
+ # expect(foo).to match_style(bar: 'baz')
771
+ # expect(foo).to match_xpath(bar: 'baz')
772
+ #
773
+ # # also good - It checks "true" strictly.
774
+ # expect(foo.matches_style?(bar: 'baz')).to be(true)
775
+ #
776
+ # @example Strict: false, EnforcedStyle: inflected
777
+ # # bad
778
+ # expect(foo.matches_style?(bar: 'baz')).to be_truthy
779
+ # expect(foo.matches_style?(bar: 'baz')).to be(true)
780
+ #
781
+ # # good
782
+ # expect(foo).to match_style(bar: 'baz')
783
+ #
784
+ # @example Strict: true, EnforcedStyle: explicit
785
+ # # bad
786
+ # expect(foo).to match_style(bar: 'baz')
787
+ #
788
+ # # good - the above code is rewritten to it by this cop
789
+ # expect(foo.matches_style?(bar: 'baz')).to be(true)
790
+ #
791
+ # @example Strict: false, EnforcedStyle: explicit
792
+ # # bad
793
+ # expect(foo).to match_style(bar: 'baz')
794
+ #
795
+ # # good - the above code is rewritten to it by this cop
796
+ # expect(foo.matches_style?(bar: 'baz')).to be_truthy
797
+ #
798
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:238
799
+ class RuboCop::Cop::Capybara::RSpec::PredicateMatcher < ::RuboCop::Cop::Base
800
+ include ::RuboCop::Cop::ConfigurableEnforcedStyle
801
+ include ::RuboCop::Cop::Capybara::RSpec::InflectedHelper
802
+ include ::RuboCop::Cop::Capybara::RSpec::ExplicitHelper
803
+ extend ::RuboCop::Cop::AutoCorrector
804
+
805
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:246
806
+ def on_send(node); end
807
+
808
+ private
809
+
810
+ # returns args location with whitespace
811
+ # @example
812
+ # foo 1, 2
813
+ # ^^^^^
814
+ #
815
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:260
816
+ def args_loc(send_node); end
817
+ end
818
+
819
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/rspec/predicate_matcher.rb:244
820
+ RuboCop::Cop::Capybara::RSpec::PredicateMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
821
+
822
+ # Checks for there is a more specific actions offered by Capybara.
823
+ #
824
+ # @example
825
+ #
826
+ # # bad
827
+ # find('a').click
828
+ # find('button.cls').click
829
+ # find('a', exact_text: 'foo').click
830
+ # find('div button').click
831
+ #
832
+ # # good
833
+ # click_link
834
+ # click_button(class: 'cls')
835
+ # click_link(exact_text: 'foo')
836
+ # find('div').click_button
837
+ #
838
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:22
839
+ class RuboCop::Cop::Capybara::SpecificActions < ::RuboCop::Cop::Base
840
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:31
841
+ def click_on_selector(param0 = T.unsafe(nil)); end
842
+
843
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:35
844
+ def on_send(node); end
845
+
846
+ private
847
+
848
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:87
849
+ def good_action(action); end
850
+
851
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:73
852
+ def last_selector(arg); end
853
+
854
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:81
855
+ def message(action, selector); end
856
+
857
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:77
858
+ def offense_range(node, receiver); end
859
+
860
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:57
861
+ def replaceable?(node, arg, action); end
862
+
863
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:63
864
+ def replaceable_attributes?(selector); end
865
+
866
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:53
867
+ def specific_action(selector); end
868
+
869
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:69
870
+ def supported_selector?(selector); end
871
+ end
872
+
873
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:23
874
+ RuboCop::Cop::Capybara::SpecificActions::MSG = T.let(T.unsafe(nil), String)
875
+
876
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:24
877
+ RuboCop::Cop::Capybara::SpecificActions::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
878
+
879
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_actions.rb:25
880
+ RuboCop::Cop::Capybara::SpecificActions::SPECIFIC_ACTION = T.let(T.unsafe(nil), Hash)
881
+
882
+ # Checks if there is a more specific finder offered by Capybara.
883
+ #
884
+ # @example
885
+ # # bad
886
+ # find('#some-id')
887
+ # find('[id=some-id]')
888
+ # find(:css, '#some-id')
889
+ #
890
+ # # good
891
+ # find_by_id('some-id')
892
+ #
893
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:17
894
+ class RuboCop::Cop::Capybara::SpecificFinders < ::RuboCop::Cop::Base
895
+ include ::RuboCop::Cop::RangeHelp
896
+ extend ::RuboCop::Cop::AutoCorrector
897
+
898
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:30
899
+ def class_options(param0); end
900
+
901
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:25
902
+ def find_argument(param0 = T.unsafe(nil)); end
903
+
904
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:34
905
+ def on_send(node); end
906
+
907
+ private
908
+
909
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:93
910
+ def append_options(classes, options); end
911
+
912
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:62
913
+ def attribute?(arg); end
914
+
915
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:83
916
+ def autocorrect_classes(corrector, node, classes); end
917
+
918
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:78
919
+ def deletion_range(node); end
920
+
921
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:120
922
+ def end_pos(node); end
923
+
924
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:98
925
+ def keyword_argument_class(classes); end
926
+
927
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:116
928
+ def offense_range(node); end
929
+
930
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:46
931
+ def on_attr(node, sym, arg); end
932
+
933
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:54
934
+ def on_id(node, sym, arg); end
935
+
936
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:67
937
+ def register_offense(node, sym, id, classes = T.unsafe(nil)); end
938
+
939
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:103
940
+ def replaced_arguments(arg, id); end
941
+
942
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:108
943
+ def to_options(attrs); end
944
+ end
945
+
946
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:21
947
+ RuboCop::Cop::Capybara::SpecificFinders::MSG = T.let(T.unsafe(nil), String)
948
+
949
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_finders.rb:22
950
+ RuboCop::Cop::Capybara::SpecificFinders::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
951
+
952
+ # Checks for there is a more specific matcher offered by Capybara.
953
+ #
954
+ # @example
955
+ #
956
+ # # bad
957
+ # expect(page).to have_selector('button')
958
+ # expect(page).to have_no_selector('button.cls')
959
+ # expect(page).to have_css('button')
960
+ # expect(page).to have_no_css('a.cls', href: 'http://example.com')
961
+ # expect(page).to have_css('table.cls')
962
+ # expect(page).to have_css('select')
963
+ # expect(page).to have_css('input', exact_text: 'foo')
964
+ #
965
+ # # good
966
+ # expect(page).to have_button
967
+ # expect(page).to have_no_button(class: 'cls')
968
+ # expect(page).to have_button
969
+ # expect(page).to have_no_link('foo', class: 'cls', href: 'http://example.com')
970
+ # expect(page).to have_table(class: 'cls')
971
+ # expect(page).to have_select
972
+ # expect(page).to have_field('foo')
973
+ #
974
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:28
975
+ class RuboCop::Cop::Capybara::SpecificMatcher < ::RuboCop::Cop::Base
976
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:41
977
+ def first_argument(param0 = T.unsafe(nil)); end
978
+
979
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:45
980
+ def on_send(node); end
981
+
982
+ private
983
+
984
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:80
985
+ def good_matcher(node, matcher); end
986
+
987
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:74
988
+ def message(node, matcher); end
989
+
990
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:62
991
+ def replaceable?(node, arg, matcher); end
992
+
993
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:68
994
+ def replaceable_attributes?(selector); end
995
+
996
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:57
997
+ def specific_matcher(arg); end
998
+ end
999
+
1000
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:29
1001
+ RuboCop::Cop::Capybara::SpecificMatcher::MSG = T.let(T.unsafe(nil), String)
1002
+
1003
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:30
1004
+ RuboCop::Cop::Capybara::SpecificMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1005
+
1006
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/specific_matcher.rb:32
1007
+ RuboCop::Cop::Capybara::SpecificMatcher::SPECIFIC_MATCHER = T.let(T.unsafe(nil), Hash)
1008
+
1009
+ # Checks for boolean visibility in Capybara finders.
1010
+ #
1011
+ # Capybara lets you find elements that match a certain visibility using
1012
+ # the `:visible` option. `:visible` accepts both boolean and symbols as
1013
+ # values, however using booleans can have unwanted effects. `visible:
1014
+ # false` does not find just invisible elements, but both visible and
1015
+ # invisible elements. For expressiveness and clarity, use one of the
1016
+ # symbol values, `:all`, `:hidden` or `:visible`.
1017
+ # Read more in
1018
+ # https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all[the documentation].
1019
+ #
1020
+ # @example
1021
+ # # bad
1022
+ # expect(page).to have_selector('.foo', visible: false)
1023
+ # expect(page).to have_css('.foo', visible: true)
1024
+ # expect(page).to have_link('my link', visible: false)
1025
+ #
1026
+ # # good
1027
+ # expect(page).to have_selector('.foo', visible: :visible)
1028
+ # expect(page).to have_css('.foo', visible: :all)
1029
+ # expect(page).to have_link('my link', visible: :hidden)
1030
+ #
1031
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:28
1032
+ class RuboCop::Cop::Capybara::VisibilityMatcher < ::RuboCop::Cop::Base
1033
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:58
1034
+ def on_send(node); end
1035
+
1036
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:54
1037
+ def visible_false?(param0 = T.unsafe(nil)); end
1038
+
1039
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:49
1040
+ def visible_true?(param0 = T.unsafe(nil)); end
1041
+
1042
+ private
1043
+
1044
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:65
1045
+ def capybara_matcher?(method_name); end
1046
+ end
1047
+
1048
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:31
1049
+ RuboCop::Cop::Capybara::VisibilityMatcher::CAPYBARA_MATCHER_METHODS = T.let(T.unsafe(nil), Array)
1050
+
1051
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:29
1052
+ RuboCop::Cop::Capybara::VisibilityMatcher::MSG_FALSE = T.let(T.unsafe(nil), String)
1053
+
1054
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:30
1055
+ RuboCop::Cop::Capybara::VisibilityMatcher::MSG_TRUE = T.let(T.unsafe(nil), String)
1056
+
1057
+ # pkg:gem/rubocop-capybara#lib/rubocop/cop/capybara/visibility_matcher.rb:46
1058
+ RuboCop::Cop::Capybara::VisibilityMatcher::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)