packwerk 3.2.2 → 3.2.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/packwerk/application_validator.rb +2 -1
  3. data/lib/packwerk/graph.rb +15 -56
  4. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +1 -2
  5. data/lib/packwerk/run_context.rb +5 -0
  6. data/lib/packwerk/validators/dependency_validator.rb +5 -4
  7. data/lib/packwerk/version.rb +1 -1
  8. data/sorbet/rbi/gems/{actionpack@7.0.3.1.rbi → actionpack@7.0.8.7.rbi} +1338 -1227
  9. data/sorbet/rbi/gems/{actionview@7.0.3.1.rbi → actionview@7.0.8.7.rbi} +548 -503
  10. data/sorbet/rbi/gems/{activesupport@7.0.3.1.rbi → activesupport@7.0.8.7.rbi} +714 -635
  11. data/sorbet/rbi/gems/{better_html@2.0.1.rbi → better_html@2.1.1.rbi} +21 -21
  12. data/sorbet/rbi/gems/{concurrent-ruby@1.1.10.rbi → concurrent-ruby@1.3.5.rbi} +1390 -1366
  13. data/sorbet/rbi/gems/{constant_resolver@0.2.0.rbi → constant_resolver@0.3.0.rbi} +22 -13
  14. data/sorbet/rbi/gems/{erubi@1.11.0.rbi → erubi@1.13.1.rbi} +28 -17
  15. data/sorbet/rbi/gems/{i18n@1.12.0.rbi → i18n@1.14.7.rbi} +234 -172
  16. data/sorbet/rbi/gems/{json@2.6.2.rbi → json@2.7.2.rbi} +94 -74
  17. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  18. data/sorbet/rbi/gems/{loofah@2.18.0.rbi → loofah@2.24.0.rbi} +470 -243
  19. data/sorbet/rbi/gems/{minitest@5.16.2.rbi → minitest@5.25.4.rbi} +577 -472
  20. data/sorbet/rbi/gems/{mocha@1.14.0.rbi → mocha@2.5.0.rbi} +468 -684
  21. data/sorbet/rbi/gems/{nokogiri@1.15.3.rbi → nokogiri@1.18.4.rbi} +1756 -869
  22. data/sorbet/rbi/gems/{parallel@1.24.0.rbi → parallel@1.25.1.rbi} +26 -20
  23. data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.1.rbi} +36 -36
  24. data/sorbet/rbi/gems/{rack-test@2.0.2.rbi → rack-test@2.2.0.rbi} +87 -114
  25. data/sorbet/rbi/gems/{rack@2.2.4.rbi → rack@2.2.13.rbi} +243 -195
  26. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +754 -0
  27. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +764 -0
  28. data/sorbet/rbi/gems/{railties@7.0.3.1.rbi → railties@7.0.8.7.rbi} +146 -140
  29. data/sorbet/rbi/gems/{regexp_parser@2.5.0.rbi → regexp_parser@2.9.2.rbi} +947 -542
  30. data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.3.9.rbi} +452 -312
  31. data/sorbet/rbi/gems/{rubocop-ast@1.21.0.rbi → rubocop-ast@1.31.3.rbi} +717 -588
  32. data/sorbet/rbi/gems/{rubocop@1.34.1.rbi → rubocop@1.64.1.rbi} +10916 -4406
  33. data/sorbet/rbi/gems/{ruby-progressbar@1.11.0.rbi → ruby-progressbar@1.13.0.rbi} +359 -281
  34. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  35. data/sorbet/rbi/gems/{tzinfo@2.0.5.rbi → tzinfo@2.0.6.rbi} +144 -141
  36. data/sorbet/rbi/gems/{unicode-display_width@2.2.0.rbi → unicode-display_width@2.5.0.rbi} +24 -7
  37. metadata +36 -41
  38. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +0 -8
  39. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +0 -8
  40. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +0 -455
  41. data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +0 -542
  42. data/sorbet/rbi/gems/ruby-lsp@0.2.3.rbi +0 -11
  43. data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +0 -8
  44. /data/sorbet/rbi/gems/{builder@3.2.4.rbi → builder@3.3.0.rbi} +0 -0
  45. /data/sorbet/rbi/gems/{parser@3.3.1.0.rbi → parser@3.3.3.0.rbi} +0 -0
@@ -0,0 +1,754 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rails-dom-testing` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rails-dom-testing`.
6
+
7
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#3
8
+ module Rails
9
+ class << self
10
+ # source://railties/7.0.8.7/lib/rails.rb#38
11
+ def app_class; end
12
+
13
+ # source://railties/7.0.8.7/lib/rails.rb#38
14
+ def app_class=(_arg0); end
15
+
16
+ # source://railties/7.0.8.7/lib/rails.rb#39
17
+ def application; end
18
+
19
+ # source://railties/7.0.8.7/lib/rails.rb#37
20
+ def application=(_arg0); end
21
+
22
+ # source://railties/7.0.8.7/lib/rails.rb#123
23
+ def autoloaders; end
24
+
25
+ # source://railties/7.0.8.7/lib/rails.rb#50
26
+ def backtrace_cleaner; end
27
+
28
+ # source://railties/7.0.8.7/lib/rails.rb#38
29
+ def cache; end
30
+
31
+ # source://railties/7.0.8.7/lib/rails.rb#38
32
+ def cache=(_arg0); end
33
+
34
+ # source://railties/7.0.8.7/lib/rails.rb#46
35
+ def configuration; end
36
+
37
+ # source://railties/7.0.8.7/lib/rails.rb#72
38
+ def env; end
39
+
40
+ # source://railties/7.0.8.7/lib/rails.rb#79
41
+ def env=(environment); end
42
+
43
+ # source://railties/7.0.8.7/lib/rails.rb#90
44
+ def error; end
45
+
46
+ # source://railties/7.0.8.7/lib/rails/gem_version.rb#5
47
+ def gem_version; end
48
+
49
+ # source://railties/7.0.8.7/lib/rails.rb#103
50
+ def groups(*groups); end
51
+
52
+ # source://railties/7.0.8.7/lib/rails.rb#43
53
+ def initialize!(*_arg0, **_arg1, &_arg2); end
54
+
55
+ # source://railties/7.0.8.7/lib/rails.rb#43
56
+ def initialized?(*_arg0, **_arg1, &_arg2); end
57
+
58
+ # source://railties/7.0.8.7/lib/rails.rb#38
59
+ def logger; end
60
+
61
+ # source://railties/7.0.8.7/lib/rails.rb#38
62
+ def logger=(_arg0); end
63
+
64
+ # source://railties/7.0.8.7/lib/rails.rb#119
65
+ def public_path; end
66
+
67
+ # source://railties/7.0.8.7/lib/rails.rb#63
68
+ def root; end
69
+
70
+ # source://railties/7.0.8.7/lib/rails/version.rb#7
71
+ def version; end
72
+ end
73
+ end
74
+
75
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#4
76
+ module Rails::Dom; end
77
+
78
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#5
79
+ module Rails::Dom::Testing
80
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#12
81
+ def default_html_version; end
82
+
83
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#12
84
+ def default_html_version=(val); end
85
+
86
+ class << self
87
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#12
88
+ def default_html_version; end
89
+
90
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#12
91
+ def default_html_version=(val); end
92
+
93
+ # @return [Boolean]
94
+ #
95
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#15
96
+ def html5_support?; end
97
+
98
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#19
99
+ def html_document(html_version: T.unsafe(nil)); end
100
+
101
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#26
102
+ def html_document_fragment(html_version: T.unsafe(nil)); end
103
+
104
+ private
105
+
106
+ # source://rails-dom-testing//lib/rails/dom/testing.rb#34
107
+ def choose_html_parser(parser_classes, html_version: T.unsafe(nil)); end
108
+ end
109
+ end
110
+
111
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#6
112
+ module Rails::Dom::Testing::Assertions
113
+ include ::Rails::Dom::Testing::Assertions::DomAssertions
114
+ include ::Rails::Dom::Testing::Assertions::SelectorAssertions
115
+ end
116
+
117
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#7
118
+ module Rails::Dom::Testing::Assertions::DomAssertions
119
+ # \Test two HTML strings for equivalency (e.g., equal even when attributes are in another order)
120
+ #
121
+ # # assert that the referenced method generates the appropriate HTML string
122
+ # assert_dom_equal(
123
+ # '<a href="http://www.example.com">Apples</a>',
124
+ # link_to("Apples", "http://www.example.com"),
125
+ # )
126
+ #
127
+ # By default, the matcher will not pay attention to whitespace in text nodes (e.g., spaces
128
+ # and newlines). If you want stricter matching with exact matching for whitespace, pass
129
+ # <tt>strict: true</tt>:
130
+ #
131
+ # # these assertions will both pass
132
+ # assert_dom_equal "<div>\nfoo\n\</div>", "<div>foo</div>", strict: false
133
+ # assert_dom_not_equal "<div>\nfoo\n\</div>", "<div>foo</div>", strict: true
134
+ #
135
+ # The DOMs are created using an HTML parser specified by
136
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
137
+ #
138
+ # When testing in a Rails application, the parser default can also be set by setting
139
+ # +Rails.application.config.dom_testing_default_html_version+.
140
+ #
141
+ # If you want to specify the HTML parser just for a particular assertion, pass
142
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
143
+ #
144
+ # assert_dom_equal expected, actual, html_version: :html5
145
+ #
146
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#35
147
+ def assert_dom_equal(expected, actual, message = T.unsafe(nil), strict: T.unsafe(nil), html_version: T.unsafe(nil)); end
148
+
149
+ # The negated form of +assert_dom_equal+.
150
+ #
151
+ # # assert that the referenced method does not generate the specified HTML string
152
+ # assert_dom_not_equal(
153
+ # '<a href="http://www.example.com">Apples</a>',
154
+ # link_to("Oranges", "http://www.example.com"),
155
+ # )
156
+ #
157
+ # By default, the matcher will not pay attention to whitespace in text nodes (e.g., spaces
158
+ # and newlines). If you want stricter matching with exact matching for whitespace, pass
159
+ # <tt>strict: true</tt>:
160
+ #
161
+ # # these assertions will both pass
162
+ # assert_dom_equal "<div>\nfoo\n\</div>", "<div>foo</div>", strict: false
163
+ # assert_dom_not_equal "<div>\nfoo\n\</div>", "<div>foo</div>", strict: true
164
+ #
165
+ # The DOMs are created using an HTML parser specified by
166
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
167
+ #
168
+ # When testing in a Rails application, the parser default can also be set by setting
169
+ # +Rails.application.config.dom_testing_default_html_version+.
170
+ #
171
+ # If you want to specify the HTML parser just for a particular assertion, pass
172
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
173
+ #
174
+ # assert_dom_not_equal expected, actual, html_version: :html5
175
+ #
176
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#68
177
+ def assert_dom_not_equal(expected, actual, message = T.unsafe(nil), strict: T.unsafe(nil), html_version: T.unsafe(nil)); end
178
+
179
+ protected
180
+
181
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#75
182
+ def compare_doms(expected, actual, strict); end
183
+
184
+ # @return [Boolean]
185
+ #
186
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#128
187
+ def equal_attribute?(attr, other_attr); end
188
+
189
+ # @return [Boolean]
190
+ #
191
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#115
192
+ def equal_attribute_nodes?(nodes, other_nodes); end
193
+
194
+ # @return [Boolean]
195
+ #
196
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#107
197
+ def equal_child?(child, other_child, strict); end
198
+
199
+ # @return [Boolean]
200
+ #
201
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#95
202
+ def equal_children?(child, other_child, strict); end
203
+
204
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#87
205
+ def extract_children(node, strict); end
206
+
207
+ private
208
+
209
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#133
210
+ def fragment(text, html_version: T.unsafe(nil)); end
211
+ end
212
+
213
+ # Adds the +assert_dom+ method for use in Rails functional
214
+ # test cases, which can be used to make assertions on the response HTML of a controller
215
+ # action. You can also call +assert_dom+ within another +assert_dom+ to
216
+ # make assertions on elements selected by the enclosing assertion.
217
+ #
218
+ # Use +css_select+ to select elements without making an assertions, either
219
+ # from the response HTML or elements selected by the enclosing assertion.
220
+ #
221
+ # In addition to HTML responses, you can make the following assertions:
222
+ #
223
+ # * +assert_dom_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions.
224
+ # * +assert_dom_email+ - Assertions on the HTML body of an e-mail.
225
+ #
226
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#7
227
+ module Rails::Dom::Testing::Assertions::SelectorAssertions
228
+ # An assertion that selects elements and makes one or more equality tests.
229
+ #
230
+ # If the first argument is an element, selects all matching elements
231
+ # starting from (and including) that element and all its children in
232
+ # depth-first order.
233
+ #
234
+ # If no element is specified +assert_dom+ selects from
235
+ # the element returned in +document_root_element+
236
+ # unless +assert_dom+ is called from within an +assert_dom+ block.
237
+ # Override +document_root_element+ to tell +assert_dom+ what to select from.
238
+ # The default implementation raises an exception explaining this.
239
+ #
240
+ # When called with a block +assert_dom+ passes an array of selected elements
241
+ # to the block. Calling +assert_dom+ from the block, with no element specified,
242
+ # runs the assertion on the complete set of elements selected by the enclosing assertion.
243
+ # Alternatively the array may be iterated through so that +assert_dom+ can be called
244
+ # separately for each element.
245
+ #
246
+ #
247
+ # ==== Example
248
+ # If the response contains two ordered lists, each with four list elements then:
249
+ # assert_dom "ol" do |elements|
250
+ # elements.each do |element|
251
+ # assert_dom element, "li", 4
252
+ # end
253
+ # end
254
+ #
255
+ # will pass, as will:
256
+ # assert_dom "ol" do
257
+ # assert_dom "li", 8
258
+ # end
259
+ #
260
+ # The selector may be a CSS selector expression (String, Symbol, or Numeric) or an expression
261
+ # with substitution values (Array).
262
+ # Substitution uses a custom pseudo class match. Pass in whatever attribute you want to match (enclosed in quotes) and a ? for the substitution.
263
+ # assert_dom returns nil if called with an invalid css selector.
264
+ #
265
+ # assert_dom "div:match('id', ?)", "id_string"
266
+ # assert_dom "div:match('id', ?)", :id_string
267
+ # assert_dom "div:match('id', ?)", 1
268
+ # assert_dom "div:match('id', ?)", /\d+/
269
+ #
270
+ # === Equality Tests
271
+ #
272
+ # The equality test may be one of the following:
273
+ # * <tt>true</tt> - Assertion is true if at least one element selected.
274
+ # * <tt>false</tt> - Assertion is true if no element selected.
275
+ # * <tt>String/Regexp</tt> - Assertion is true if the text value of at least
276
+ # one element matches the string or regular expression.
277
+ # * <tt>Integer</tt> - Assertion is true if exactly that number of
278
+ # elements are selected.
279
+ # * <tt>Range</tt> - Assertion is true if the number of selected
280
+ # elements fit the range.
281
+ # If no equality test specified, the assertion is true if at least one
282
+ # element selected.
283
+ #
284
+ # To perform more than one equality tests, use a hash with the following keys:
285
+ # * <tt>:text</tt> - Narrow the selection to elements that have this text
286
+ # value (string or regexp).
287
+ # * <tt>:html</tt> - Narrow the selection to elements that have this HTML
288
+ # content (string or regexp).
289
+ # * <tt>:count</tt> - Assertion is true if the number of selected elements
290
+ # is equal to this value.
291
+ # * <tt>:minimum</tt> - Assertion is true if the number of selected
292
+ # elements is at least this value.
293
+ # * <tt>:maximum</tt> - Assertion is true if the number of selected
294
+ # elements is at most this value.
295
+ #
296
+ # If the method is called with a block, once all equality tests are
297
+ # evaluated the block is called with an array of all matched elements.
298
+ #
299
+ # # At least one form element
300
+ # assert_dom "form"
301
+ #
302
+ # # Form element includes four input fields
303
+ # assert_dom "form input", 4
304
+ #
305
+ # # Page title is "Welcome"
306
+ # assert_dom "title", "Welcome"
307
+ #
308
+ # # Page title is "Welcome" and there is only one title element
309
+ # assert_dom "title", {count: 1, text: "Welcome"},
310
+ # "Wrong title or more than one title element"
311
+ #
312
+ # # Page contains no forms
313
+ # assert_dom "form", false, "This page must contain no forms"
314
+ #
315
+ # # Test the content and style
316
+ # assert_dom "body div.header ul.menu"
317
+ #
318
+ # # Use substitution values
319
+ # assert_dom "ol>li:match('id', ?)", /item-\d+/
320
+ #
321
+ # # All input fields in the form have a name
322
+ # assert_dom "form input" do
323
+ # assert_dom ":match('name', ?)", /.+/ # Not empty
324
+ # end
325
+ #
326
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#163
327
+ def assert_dom(*args, &block); end
328
+
329
+ # Extracts the body of an email and runs nested assertions on it.
330
+ #
331
+ # You must enable deliveries for this assertion to work, use:
332
+ # ActionMailer::Base.perform_deliveries = true
333
+ #
334
+ # Example usage:
335
+ #
336
+ # assert_dom_email do
337
+ # assert_dom "h1", "Email alert"
338
+ # end
339
+ #
340
+ # assert_dom_email do
341
+ # items = assert_dom "ol>li"
342
+ # items.each do
343
+ # # Work with items here...
344
+ # end
345
+ # end
346
+ #
347
+ # The DOM is created using an HTML parser specified by
348
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
349
+ #
350
+ # When testing in a Rails application, the parser default can also be set by setting
351
+ # +Rails.application.config.dom_testing_default_html_version+.
352
+ #
353
+ # If you want to specify the HTML parser just for a particular assertion, pass
354
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
355
+ #
356
+ # assert_dom_email(html_version: :html5) do
357
+ # assert_dom "h1", "Email alert"
358
+ # end
359
+ #
360
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#285
361
+ def assert_dom_email(html_version: T.unsafe(nil), &block); end
362
+
363
+ # Extracts the content of an element, treats it as encoded HTML and runs
364
+ # nested assertion on it.
365
+ #
366
+ # You typically call this method within another assertion to operate on
367
+ # all currently selected elements. You can also pass an element or array
368
+ # of elements.
369
+ #
370
+ # The content of each element is un-encoded, and wrapped in the root
371
+ # element +encoded+. It then calls the block with all un-encoded elements.
372
+ #
373
+ # # Selects all bold tags from within the title of an Atom feed's entries (perhaps to nab a section name prefix)
374
+ # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do
375
+ # # Select each entry item and then the title item
376
+ # assert_dom "entry>title" do
377
+ # # Run assertions on the encoded title elements
378
+ # assert_dom_encoded do
379
+ # assert_dom "b"
380
+ # end
381
+ # end
382
+ # end
383
+ #
384
+ #
385
+ # # Selects all paragraph tags from within the description of an RSS feed
386
+ # assert_dom "rss[version=2.0]" do
387
+ # # Select description element of each feed item.
388
+ # assert_dom "channel>item>description" do
389
+ # # Run assertions on the encoded elements.
390
+ # assert_dom_encoded do
391
+ # assert_dom "p"
392
+ # end
393
+ # end
394
+ # end
395
+ #
396
+ # The DOM is created using an HTML parser specified by
397
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
398
+ #
399
+ # When testing in a Rails application, the parser default can also be set by setting
400
+ # +Rails.application.config.dom_testing_default_html_version+.
401
+ #
402
+ # If you want to specify the HTML parser just for a particular assertion, pass
403
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
404
+ #
405
+ # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do
406
+ # assert_dom "entry>title" do
407
+ # assert_dom_encoded(html_version: :html5) do
408
+ # assert_dom "b"
409
+ # end
410
+ # end
411
+ # end
412
+ #
413
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#232
414
+ def assert_dom_encoded(element = T.unsafe(nil), html_version: T.unsafe(nil), &block); end
415
+
416
+ # An assertion that selects elements and makes one or more equality tests.
417
+ #
418
+ # If the first argument is an element, selects all matching elements
419
+ # starting from (and including) that element and all its children in
420
+ # depth-first order.
421
+ #
422
+ # If no element is specified +assert_dom+ selects from
423
+ # the element returned in +document_root_element+
424
+ # unless +assert_dom+ is called from within an +assert_dom+ block.
425
+ # Override +document_root_element+ to tell +assert_dom+ what to select from.
426
+ # The default implementation raises an exception explaining this.
427
+ #
428
+ # When called with a block +assert_dom+ passes an array of selected elements
429
+ # to the block. Calling +assert_dom+ from the block, with no element specified,
430
+ # runs the assertion on the complete set of elements selected by the enclosing assertion.
431
+ # Alternatively the array may be iterated through so that +assert_dom+ can be called
432
+ # separately for each element.
433
+ #
434
+ #
435
+ # ==== Example
436
+ # If the response contains two ordered lists, each with four list elements then:
437
+ # assert_dom "ol" do |elements|
438
+ # elements.each do |element|
439
+ # assert_dom element, "li", 4
440
+ # end
441
+ # end
442
+ #
443
+ # will pass, as will:
444
+ # assert_dom "ol" do
445
+ # assert_dom "li", 8
446
+ # end
447
+ #
448
+ # The selector may be a CSS selector expression (String, Symbol, or Numeric) or an expression
449
+ # with substitution values (Array).
450
+ # Substitution uses a custom pseudo class match. Pass in whatever attribute you want to match (enclosed in quotes) and a ? for the substitution.
451
+ # assert_dom returns nil if called with an invalid css selector.
452
+ #
453
+ # assert_dom "div:match('id', ?)", "id_string"
454
+ # assert_dom "div:match('id', ?)", :id_string
455
+ # assert_dom "div:match('id', ?)", 1
456
+ # assert_dom "div:match('id', ?)", /\d+/
457
+ #
458
+ # === Equality Tests
459
+ #
460
+ # The equality test may be one of the following:
461
+ # * <tt>true</tt> - Assertion is true if at least one element selected.
462
+ # * <tt>false</tt> - Assertion is true if no element selected.
463
+ # * <tt>String/Regexp</tt> - Assertion is true if the text value of at least
464
+ # one element matches the string or regular expression.
465
+ # * <tt>Integer</tt> - Assertion is true if exactly that number of
466
+ # elements are selected.
467
+ # * <tt>Range</tt> - Assertion is true if the number of selected
468
+ # elements fit the range.
469
+ # If no equality test specified, the assertion is true if at least one
470
+ # element selected.
471
+ #
472
+ # To perform more than one equality tests, use a hash with the following keys:
473
+ # * <tt>:text</tt> - Narrow the selection to elements that have this text
474
+ # value (string or regexp).
475
+ # * <tt>:html</tt> - Narrow the selection to elements that have this HTML
476
+ # content (string or regexp).
477
+ # * <tt>:count</tt> - Assertion is true if the number of selected elements
478
+ # is equal to this value.
479
+ # * <tt>:minimum</tt> - Assertion is true if the number of selected
480
+ # elements is at least this value.
481
+ # * <tt>:maximum</tt> - Assertion is true if the number of selected
482
+ # elements is at most this value.
483
+ #
484
+ # If the method is called with a block, once all equality tests are
485
+ # evaluated the block is called with an array of all matched elements.
486
+ #
487
+ # # At least one form element
488
+ # assert_dom "form"
489
+ #
490
+ # # Form element includes four input fields
491
+ # assert_dom "form input", 4
492
+ #
493
+ # # Page title is "Welcome"
494
+ # assert_dom "title", "Welcome"
495
+ #
496
+ # # Page title is "Welcome" and there is only one title element
497
+ # assert_dom "title", {count: 1, text: "Welcome"},
498
+ # "Wrong title or more than one title element"
499
+ #
500
+ # # Page contains no forms
501
+ # assert_dom "form", false, "This page must contain no forms"
502
+ #
503
+ # # Test the content and style
504
+ # assert_dom "body div.header ul.menu"
505
+ #
506
+ # # Use substitution values
507
+ # assert_dom "ol>li:match('id', ?)", /item-\d+/
508
+ #
509
+ # # All input fields in the form have a name
510
+ # assert_dom "form input" do
511
+ # assert_dom ":match('name', ?)", /.+/ # Not empty
512
+ # end
513
+ #
514
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#163
515
+ def assert_select(*args, &block); end
516
+
517
+ # Extracts the body of an email and runs nested assertions on it.
518
+ #
519
+ # You must enable deliveries for this assertion to work, use:
520
+ # ActionMailer::Base.perform_deliveries = true
521
+ #
522
+ # Example usage:
523
+ #
524
+ # assert_dom_email do
525
+ # assert_dom "h1", "Email alert"
526
+ # end
527
+ #
528
+ # assert_dom_email do
529
+ # items = assert_dom "ol>li"
530
+ # items.each do
531
+ # # Work with items here...
532
+ # end
533
+ # end
534
+ #
535
+ # The DOM is created using an HTML parser specified by
536
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
537
+ #
538
+ # When testing in a Rails application, the parser default can also be set by setting
539
+ # +Rails.application.config.dom_testing_default_html_version+.
540
+ #
541
+ # If you want to specify the HTML parser just for a particular assertion, pass
542
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
543
+ #
544
+ # assert_dom_email(html_version: :html5) do
545
+ # assert_dom "h1", "Email alert"
546
+ # end
547
+ #
548
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#285
549
+ def assert_select_email(html_version: T.unsafe(nil), &block); end
550
+
551
+ # Extracts the content of an element, treats it as encoded HTML and runs
552
+ # nested assertion on it.
553
+ #
554
+ # You typically call this method within another assertion to operate on
555
+ # all currently selected elements. You can also pass an element or array
556
+ # of elements.
557
+ #
558
+ # The content of each element is un-encoded, and wrapped in the root
559
+ # element +encoded+. It then calls the block with all un-encoded elements.
560
+ #
561
+ # # Selects all bold tags from within the title of an Atom feed's entries (perhaps to nab a section name prefix)
562
+ # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do
563
+ # # Select each entry item and then the title item
564
+ # assert_dom "entry>title" do
565
+ # # Run assertions on the encoded title elements
566
+ # assert_dom_encoded do
567
+ # assert_dom "b"
568
+ # end
569
+ # end
570
+ # end
571
+ #
572
+ #
573
+ # # Selects all paragraph tags from within the description of an RSS feed
574
+ # assert_dom "rss[version=2.0]" do
575
+ # # Select description element of each feed item.
576
+ # assert_dom "channel>item>description" do
577
+ # # Run assertions on the encoded elements.
578
+ # assert_dom_encoded do
579
+ # assert_dom "p"
580
+ # end
581
+ # end
582
+ # end
583
+ #
584
+ # The DOM is created using an HTML parser specified by
585
+ # Rails::Dom::Testing.default_html_version (either :html4 or :html5).
586
+ #
587
+ # When testing in a Rails application, the parser default can also be set by setting
588
+ # +Rails.application.config.dom_testing_default_html_version+.
589
+ #
590
+ # If you want to specify the HTML parser just for a particular assertion, pass
591
+ # <tt>html_version: :html4</tt> or <tt>html_version: :html5</tt> keyword arguments:
592
+ #
593
+ # assert_dom "feed[xmlns='http://www.w3.org/2005/Atom']" do
594
+ # assert_dom "entry>title" do
595
+ # assert_dom_encoded(html_version: :html5) do
596
+ # assert_dom "b"
597
+ # end
598
+ # end
599
+ # end
600
+ #
601
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#232
602
+ def assert_select_encoded(element = T.unsafe(nil), html_version: T.unsafe(nil), &block); end
603
+
604
+ # Select and return all matching elements.
605
+ #
606
+ # If called with a single argument, uses that argument as a selector.
607
+ # Called without an element +css_select+ selects from
608
+ # the element returned in +document_root_element+
609
+ #
610
+ # The default implementation of +document_root_element+ raises an exception explaining this.
611
+ #
612
+ # Returns an empty Nokogiri::XML::NodeSet if no match is found.
613
+ #
614
+ # If called with two arguments, uses the first argument as the root
615
+ # element and the second argument as the selector. Attempts to match the
616
+ # root element and any of its children.
617
+ # Returns an empty Nokogiri::XML::NodeSet if no match is found.
618
+ #
619
+ # The selector may be a CSS selector expression (String).
620
+ # css_select returns nil if called with an invalid css selector.
621
+ #
622
+ # # Selects all div tags
623
+ # divs = css_select("div")
624
+ #
625
+ # # Selects all paragraph tags and does something interesting
626
+ # pars = css_select("p")
627
+ # pars.each do |par|
628
+ # # Do something fun with paragraphs here...
629
+ # end
630
+ #
631
+ # # Selects all list items in unordered lists
632
+ # items = css_select("ul>li")
633
+ #
634
+ # # Selects all form tags and then all inputs inside the form
635
+ # forms = css_select("form")
636
+ # forms.each do |form|
637
+ # inputs = css_select(form, "input")
638
+ # ...
639
+ # end
640
+ #
641
+ # @raise [ArgumentError]
642
+ #
643
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#58
644
+ def css_select(*args); end
645
+
646
+ private
647
+
648
+ # +equals+ must contain :minimum, :maximum and :count keys
649
+ #
650
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#307
651
+ def assert_size_match!(size, equals, css_selector, message = T.unsafe(nil)); end
652
+
653
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#319
654
+ def count_description(min, max, count); end
655
+
656
+ # @raise [NotImplementedError]
657
+ #
658
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#301
659
+ def document_root_element; end
660
+
661
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#335
662
+ def nest_selection(selection); end
663
+
664
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#344
665
+ def nodeset(node); end
666
+
667
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#331
668
+ def pluralize_element(quantity); end
669
+ end
670
+
671
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#12
672
+ class Rails::Dom::Testing::Assertions::SelectorAssertions::HTMLSelector
673
+ include ::Minitest::Assertions
674
+
675
+ # @return [HTMLSelector] a new instance of HTMLSelector
676
+ #
677
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#17
678
+ def initialize(values, previous_selection = T.unsafe(nil), &root_fallback); end
679
+
680
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#46
681
+ def context; end
682
+
683
+ # Returns the value of attribute css_selector.
684
+ #
685
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#13
686
+ def css_selector; end
687
+
688
+ # Returns the value of attribute message.
689
+ #
690
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#13
691
+ def message; end
692
+
693
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#39
694
+ def select; end
695
+
696
+ # @return [Boolean]
697
+ #
698
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#33
699
+ def selecting_no_body?; end
700
+
701
+ # Returns the value of attribute tests.
702
+ #
703
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#13
704
+ def tests; end
705
+
706
+ private
707
+
708
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#100
709
+ def extract_equality_tests; end
710
+
711
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#72
712
+ def extract_root(previous_selection, root_fallback); end
713
+
714
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#89
715
+ def extract_selectors; end
716
+
717
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#48
718
+ def filter(matches); end
719
+
720
+ class << self
721
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#46
722
+ def context; end
723
+ end
724
+ end
725
+
726
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#44
727
+ Rails::Dom::Testing::Assertions::SelectorAssertions::HTMLSelector::NO_STRIP = T.let(T.unsafe(nil), Array)
728
+
729
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#8
730
+ class Rails::Dom::Testing::Assertions::SelectorAssertions::SubstitutionContext
731
+ # @return [SubstitutionContext] a new instance of SubstitutionContext
732
+ #
733
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#9
734
+ def initialize; end
735
+
736
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#20
737
+ def match(matches, attribute, matcher); end
738
+
739
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#13
740
+ def substitute!(selector, values, format_for_presentation = T.unsafe(nil)); end
741
+
742
+ private
743
+
744
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#25
745
+ def matcher_for(value, format_for_presentation); end
746
+
747
+ # @return [Boolean]
748
+ #
749
+ # source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#36
750
+ def substitutable?(value); end
751
+ end
752
+
753
+ # source://rails-dom-testing//lib/rails/dom/testing/railtie.rb#6
754
+ class Rails::Dom::Testing::Railtie < ::Rails::Railtie; end