konstruo 1.0.0

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