packwerk 3.2.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/packwerk/association_inspector.rb +17 -4
- data/lib/packwerk/checker.rb +3 -3
- data/lib/packwerk/configuration.rb +4 -0
- data/lib/packwerk/const_node_inspector.rb +2 -2
- data/lib/packwerk/constant_name_inspector.rb +2 -2
- data/lib/packwerk/offenses_formatter.rb +3 -3
- data/lib/packwerk/package.rb +1 -1
- data/lib/packwerk/package_todo.rb +1 -4
- data/lib/packwerk/parsers/factory.rb +3 -3
- data/lib/packwerk/parsers/ruby.rb +7 -0
- data/lib/packwerk/reference_extractor.rb +29 -1
- data/lib/packwerk/reference_offense.rb +1 -1
- data/lib/packwerk/run_context.rb +15 -4
- data/lib/packwerk/validator.rb +3 -3
- data/lib/packwerk/version.rb +1 -1
- data/lib/packwerk.rb +1 -0
- data/sorbet/config +1 -0
- data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +3280 -3450
- data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +2322 -1782
- data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +2654 -3268
- data/sorbet/rbi/gems/ast@2.4.2.rbi +535 -6
- data/sorbet/rbi/gems/better_html@2.0.1.rbi +529 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +4 -4
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +32 -4
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +1750 -1840
- data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +15 -15
- data/sorbet/rbi/gems/crass@1.0.6.rbi +489 -5
- data/sorbet/rbi/gems/erubi@1.11.0.rbi +24 -21
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +395 -395
- data/sorbet/rbi/gems/json@2.6.2.rbi +70 -77
- data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +1 -1
- data/sorbet/rbi/gems/loofah@2.18.0.rbi +134 -134
- data/sorbet/rbi/gems/m@1.6.0.rbi +60 -60
- data/sorbet/rbi/gems/method_source@1.1.0.rbi +303 -0
- data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +22 -28
- data/sorbet/rbi/gems/minitest@5.16.2.rbi +384 -396
- data/sorbet/rbi/gems/mocha@1.14.0.rbi +589 -589
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +37 -32
- data/sorbet/rbi/gems/nokogiri@1.15.3.rbi +962 -946
- data/sorbet/rbi/gems/{parallel@1.22.1.rbi → parallel@1.24.0.rbi} +85 -82
- data/sorbet/rbi/gems/{parser@3.2.2.0.rbi → parser@3.3.1.0.rbi} +1679 -1609
- data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +1 -1
- data/sorbet/rbi/gems/{prism@0.24.0.rbi → prism@0.27.0.rbi} +13473 -6472
- data/sorbet/rbi/gems/{racc@1.6.0.rbi → racc@1.7.1.rbi} +42 -33
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +148 -338
- data/sorbet/rbi/gems/rack@2.2.4.rbi +1079 -1130
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +354 -22
- data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +113 -259
- data/sorbet/rbi/gems/railties@7.0.3.1.rbi +642 -638
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +109 -99
- data/sorbet/rbi/gems/rake@13.0.6.rbi +714 -599
- data/sorbet/rbi/gems/{rbi@0.0.15.rbi → rbi@0.1.12.rbi} +865 -801
- data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +853 -870
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +480 -477
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +1621 -1622
- data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +507 -526
- data/sorbet/rbi/gems/rubocop-shopify@2.9.0.rbi +1 -1
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +186 -203
- data/sorbet/rbi/gems/rubocop@1.34.1.rbi +8126 -8367
- data/sorbet/rbi/gems/{ruby-lsp@0.2.1.rbi → ruby-lsp@0.2.3.rbi} +2 -2
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1235 -4
- data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +90 -90
- data/sorbet/rbi/gems/spoom@1.3.2.rbi +4420 -0
- data/sorbet/rbi/gems/spring@4.0.0.rbi +104 -104
- data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +1 -1
- data/sorbet/rbi/gems/{tapioca@0.9.2.rbi → tapioca@0.13.3.rbi} +1596 -1253
- data/sorbet/rbi/gems/{thor@1.2.1.rbi → thor@1.3.1.rbi} +1047 -652
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +531 -513
- data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +13 -13
- data/sorbet/rbi/gems/{yard-sorbet@0.6.1.rbi → yard-sorbet@0.8.1.rbi} +132 -92
- data/sorbet/rbi/gems/{yard@0.9.28.rbi → yard@0.9.36.rbi} +3158 -3067
- data/sorbet/rbi/gems/zeitwerk@2.6.4.rbi +149 -145
- metadata +22 -94
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -27
- data/.github/pull_request_template.md +0 -28
- data/.github/workflows/ci.yml +0 -93
- data/.github/workflows/cla.yml +0 -22
- data/.gitignore +0 -13
- data/.rubocop.yml +0 -75
- data/.ruby-version +0 -1
- data/CODEOWNERS +0 -1
- data/CODE_OF_CONDUCT.md +0 -76
- data/CONTRIBUTING.md +0 -17
- data/Gemfile +0 -27
- data/Gemfile.lock +0 -206
- data/RESOLVING_VIOLATIONS.md +0 -76
- data/Rakefile +0 -22
- data/TROUBLESHOOT.md +0 -44
- data/UPGRADING.md +0 -66
- data/USAGE.md +0 -364
- data/bin/console +0 -15
- data/bin/m +0 -29
- data/bin/rake +0 -29
- data/bin/rubocop +0 -29
- data/bin/setup +0 -8
- data/bin/srb +0 -29
- data/bin/tapioca +0 -29
- data/dev.yml +0 -32
- data/docs/cohesion.png +0 -0
- data/gemfiles/Gemfile-rails-6-0 +0 -22
- data/gemfiles/Gemfile-rails-6-1 +0 -22
- data/packwerk.gemspec +0 -59
- data/shipit.rubygems.yml +0 -5
- data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +0 -2754
- data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +0 -1496
- data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +0 -2362
- data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +0 -1569
- data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +0 -2553
- data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +0 -5999
- data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +0 -37832
- data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +0 -2321
- data/sorbet/rbi/gems/better_html@1.0.16.rbi +0 -317
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +0 -8
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1079
- data/sorbet/rbi/gems/digest@3.1.0.rbi +0 -189
- data/sorbet/rbi/gems/globalid@1.0.0.rbi +0 -572
- data/sorbet/rbi/gems/mail@2.7.1.rbi +0 -2490
- data/sorbet/rbi/gems/marcel@1.0.2.rbi +0 -220
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +0 -76
- data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +0 -170
- data/sorbet/rbi/gems/net-imap@0.2.3.rbi +0 -2147
- data/sorbet/rbi/gems/net-pop@0.1.1.rbi +0 -926
- data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +0 -11
- data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +0 -1108
- data/sorbet/rbi/gems/nio4r@2.5.8.rbi +0 -292
- data/sorbet/rbi/gems/pry@0.14.1.rbi +0 -8
- data/sorbet/rbi/gems/rails@7.0.3.1.rbi +0 -8
- data/sorbet/rbi/gems/spoom@1.1.11.rbi +0 -2181
- data/sorbet/rbi/gems/strscan@3.0.4.rbi +0 -8
- data/sorbet/rbi/gems/timeout@0.3.0.rbi +0 -142
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +0 -4529
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +0 -2582
- data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +0 -993
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +0 -71
@@ -1,123 +1,455 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
1
3
|
# DO NOT EDIT MANUALLY
|
2
4
|
# This is an autogenerated file for types exported from the `rails-dom-testing` gem.
|
3
|
-
# Please instead update this file by running `
|
4
|
-
|
5
|
-
# typed: true
|
5
|
+
# Please instead update this file by running `bin/tapioca gem rails-dom-testing`.
|
6
6
|
|
7
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#4
|
7
8
|
class HTMLSelector
|
9
|
+
# @return [HTMLSelector] a new instance of HTMLSelector
|
10
|
+
#
|
11
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#7
|
8
12
|
def initialize(values, previous_selection = T.unsafe(nil), &root_fallback); end
|
9
13
|
|
14
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#33
|
10
15
|
def context; end
|
16
|
+
|
17
|
+
# Returns the value of attribute css_selector.
|
18
|
+
#
|
19
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
11
20
|
def css_selector; end
|
21
|
+
|
22
|
+
# Returns the value of attribute message.
|
23
|
+
#
|
24
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
12
25
|
def message; end
|
26
|
+
|
27
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#25
|
13
28
|
def select; end
|
29
|
+
|
30
|
+
# @return [Boolean]
|
31
|
+
#
|
32
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#19
|
14
33
|
def selecting_no_body?; end
|
34
|
+
|
35
|
+
# Returns the value of attribute tests.
|
36
|
+
#
|
37
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
15
38
|
def tests; end
|
16
39
|
|
17
40
|
private
|
18
41
|
|
42
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#87
|
19
43
|
def extract_equality_tests; end
|
44
|
+
|
45
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#59
|
20
46
|
def extract_root(previous_selection, root_fallback); end
|
47
|
+
|
48
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#76
|
21
49
|
def extract_selectors; end
|
50
|
+
|
51
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#35
|
22
52
|
def filter(matches); end
|
23
53
|
|
24
54
|
class << self
|
55
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#33
|
25
56
|
def context; end
|
26
57
|
end
|
27
58
|
end
|
28
59
|
|
60
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#31
|
29
61
|
HTMLSelector::NO_STRIP = T.let(T.unsafe(nil), Array)
|
30
62
|
|
63
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#4
|
31
64
|
module Rails
|
32
|
-
extend(::ActiveSupport::Autoload)
|
33
|
-
|
34
65
|
class << self
|
66
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
35
67
|
def app_class; end
|
36
|
-
|
68
|
+
|
69
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
70
|
+
def app_class=(_arg0); end
|
71
|
+
|
72
|
+
# source://railties/7.0.3.1/lib/rails.rb#39
|
37
73
|
def application; end
|
38
|
-
|
74
|
+
|
75
|
+
# source://railties/7.0.3.1/lib/rails.rb#37
|
76
|
+
def application=(_arg0); end
|
77
|
+
|
78
|
+
# source://railties/7.0.3.1/lib/rails.rb#116
|
39
79
|
def autoloaders; end
|
80
|
+
|
81
|
+
# source://railties/7.0.3.1/lib/rails.rb#50
|
40
82
|
def backtrace_cleaner; end
|
83
|
+
|
84
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
41
85
|
def cache; end
|
42
|
-
|
86
|
+
|
87
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
88
|
+
def cache=(_arg0); end
|
89
|
+
|
90
|
+
# source://railties/7.0.3.1/lib/rails.rb#46
|
43
91
|
def configuration; end
|
92
|
+
|
93
|
+
# source://railties/7.0.3.1/lib/rails.rb#72
|
44
94
|
def env; end
|
95
|
+
|
96
|
+
# source://railties/7.0.3.1/lib/rails.rb#79
|
45
97
|
def env=(environment); end
|
98
|
+
|
99
|
+
# source://railties/7.0.3.1/lib/rails.rb#83
|
100
|
+
def error; end
|
101
|
+
|
102
|
+
# source://railties/7.0.3.1/lib/rails/gem_version.rb#5
|
46
103
|
def gem_version; end
|
104
|
+
|
105
|
+
# source://railties/7.0.3.1/lib/rails.rb#96
|
47
106
|
def groups(*groups); end
|
48
|
-
|
49
|
-
|
107
|
+
|
108
|
+
# source://railties/7.0.3.1/lib/rails.rb#43
|
109
|
+
def initialize!(*_arg0, **_arg1, &_arg2); end
|
110
|
+
|
111
|
+
# source://railties/7.0.3.1/lib/rails.rb#43
|
112
|
+
def initialized?(*_arg0, **_arg1, &_arg2); end
|
113
|
+
|
114
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
50
115
|
def logger; end
|
51
|
-
|
116
|
+
|
117
|
+
# source://railties/7.0.3.1/lib/rails.rb#38
|
118
|
+
def logger=(_arg0); end
|
119
|
+
|
120
|
+
# source://railties/7.0.3.1/lib/rails.rb#112
|
52
121
|
def public_path; end
|
122
|
+
|
123
|
+
# source://railties/7.0.3.1/lib/rails.rb#63
|
53
124
|
def root; end
|
125
|
+
|
126
|
+
# source://railties/7.0.3.1/lib/rails/version.rb#7
|
54
127
|
def version; end
|
55
128
|
end
|
56
129
|
end
|
57
130
|
|
58
|
-
|
59
|
-
end
|
131
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#5
|
132
|
+
module Rails::Dom; end
|
60
133
|
|
61
|
-
|
62
|
-
end
|
134
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#6
|
135
|
+
module Rails::Dom::Testing; end
|
63
136
|
|
137
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#7
|
64
138
|
module Rails::Dom::Testing::Assertions
|
65
|
-
include
|
66
|
-
include
|
67
|
-
include
|
68
|
-
extend
|
139
|
+
include ::Rails::Dom::Testing::Assertions::DomAssertions
|
140
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
141
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions
|
142
|
+
extend ::ActiveSupport::Concern
|
69
143
|
end
|
70
144
|
|
145
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#5
|
71
146
|
module Rails::Dom::Testing::Assertions::DomAssertions
|
147
|
+
# \Test two HTML strings for equivalency (e.g., equal even when attributes are in another order)
|
148
|
+
#
|
149
|
+
# # assert that the referenced method generates the appropriate HTML string
|
150
|
+
# assert_dom_equal '<a href="http://www.example.com">Apples</a>', link_to("Apples", "http://www.example.com")
|
151
|
+
#
|
152
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#10
|
72
153
|
def assert_dom_equal(expected, actual, message = T.unsafe(nil)); end
|
154
|
+
|
155
|
+
# The negated form of +assert_dom_equal+.
|
156
|
+
#
|
157
|
+
# # assert that the referenced method does not generate the specified HTML string
|
158
|
+
# assert_dom_not_equal '<a href="http://www.example.com">Apples</a>', link_to("Oranges", "http://www.example.com")
|
159
|
+
#
|
160
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#20
|
73
161
|
def assert_dom_not_equal(expected, actual, message = T.unsafe(nil)); end
|
74
162
|
|
75
163
|
protected
|
76
164
|
|
165
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#28
|
77
166
|
def compare_doms(expected, actual); end
|
167
|
+
|
168
|
+
# @return [Boolean]
|
169
|
+
#
|
170
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#63
|
78
171
|
def equal_attribute?(attr, other_attr); end
|
172
|
+
|
173
|
+
# @return [Boolean]
|
174
|
+
#
|
175
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#50
|
79
176
|
def equal_attribute_nodes?(nodes, other_nodes); end
|
177
|
+
|
178
|
+
# @return [Boolean]
|
179
|
+
#
|
180
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#38
|
80
181
|
def equal_children?(child, other_child); end
|
81
182
|
|
82
183
|
private
|
83
184
|
|
185
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#69
|
84
186
|
def fragment(text); end
|
85
187
|
end
|
86
188
|
|
189
|
+
# Adds the +assert_select+ method for use in Rails functional
|
190
|
+
# test cases, which can be used to make assertions on the response HTML of a controller
|
191
|
+
# action. You can also call +assert_select+ within another +assert_select+ to
|
192
|
+
# make assertions on elements selected by the enclosing assertion.
|
193
|
+
#
|
194
|
+
# Use +css_select+ to select elements without making an assertions, either
|
195
|
+
# from the response HTML or elements selected by the enclosing assertion.
|
196
|
+
#
|
197
|
+
# In addition to HTML responses, you can make the following assertions:
|
198
|
+
#
|
199
|
+
# * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions.
|
200
|
+
# * +assert_select_email+ - Assertions on the HTML body of an e-mail.
|
201
|
+
#
|
202
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#7
|
87
203
|
module Rails::Dom::Testing::Assertions::SelectorAssertions
|
88
|
-
include
|
204
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
89
205
|
|
206
|
+
# An assertion that selects elements and makes one or more equality tests.
|
207
|
+
#
|
208
|
+
# If the first argument is an element, selects all matching elements
|
209
|
+
# starting from (and including) that element and all its children in
|
210
|
+
# depth-first order.
|
211
|
+
#
|
212
|
+
# If no element is specified +assert_select+ selects from
|
213
|
+
# the element returned in +document_root_element+
|
214
|
+
# unless +assert_select+ is called from within an +assert_select+ block.
|
215
|
+
# Override +document_root_element+ to tell +assert_select+ what to select from.
|
216
|
+
# The default implementation raises an exception explaining this.
|
217
|
+
#
|
218
|
+
# When called with a block +assert_select+ passes an array of selected elements
|
219
|
+
# to the block. Calling +assert_select+ from the block, with no element specified,
|
220
|
+
# runs the assertion on the complete set of elements selected by the enclosing assertion.
|
221
|
+
# Alternatively the array may be iterated through so that +assert_select+ can be called
|
222
|
+
# separately for each element.
|
223
|
+
#
|
224
|
+
#
|
225
|
+
# ==== Example
|
226
|
+
# If the response contains two ordered lists, each with four list elements then:
|
227
|
+
# assert_select "ol" do |elements|
|
228
|
+
# elements.each do |element|
|
229
|
+
# assert_select element, "li", 4
|
230
|
+
# end
|
231
|
+
# end
|
232
|
+
#
|
233
|
+
# will pass, as will:
|
234
|
+
# assert_select "ol" do
|
235
|
+
# assert_select "li", 8
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
# The selector may be a CSS selector expression (String) or an expression
|
239
|
+
# with substitution values (Array).
|
240
|
+
# Substitution uses a custom pseudo class match. Pass in whatever attribute you want to match (enclosed in quotes) and a ? for the substitution.
|
241
|
+
# assert_select returns nil if called with an invalid css selector.
|
242
|
+
#
|
243
|
+
# assert_select "div:match('id', ?)", /\d+/
|
244
|
+
#
|
245
|
+
# === Equality Tests
|
246
|
+
#
|
247
|
+
# The equality test may be one of the following:
|
248
|
+
# * <tt>true</tt> - Assertion is true if at least one element selected.
|
249
|
+
# * <tt>false</tt> - Assertion is true if no element selected.
|
250
|
+
# * <tt>String/Regexp</tt> - Assertion is true if the text value of at least
|
251
|
+
# one element matches the string or regular expression.
|
252
|
+
# * <tt>Integer</tt> - Assertion is true if exactly that number of
|
253
|
+
# elements are selected.
|
254
|
+
# * <tt>Range</tt> - Assertion is true if the number of selected
|
255
|
+
# elements fit the range.
|
256
|
+
# If no equality test specified, the assertion is true if at least one
|
257
|
+
# element selected.
|
258
|
+
#
|
259
|
+
# To perform more than one equality tests, use a hash with the following keys:
|
260
|
+
# * <tt>:text</tt> - Narrow the selection to elements that have this text
|
261
|
+
# value (string or regexp).
|
262
|
+
# * <tt>:html</tt> - Narrow the selection to elements that have this HTML
|
263
|
+
# content (string or regexp).
|
264
|
+
# * <tt>:count</tt> - Assertion is true if the number of selected elements
|
265
|
+
# is equal to this value.
|
266
|
+
# * <tt>:minimum</tt> - Assertion is true if the number of selected
|
267
|
+
# elements is at least this value.
|
268
|
+
# * <tt>:maximum</tt> - Assertion is true if the number of selected
|
269
|
+
# elements is at most this value.
|
270
|
+
#
|
271
|
+
# If the method is called with a block, once all equality tests are
|
272
|
+
# evaluated the block is called with an array of all matched elements.
|
273
|
+
#
|
274
|
+
# # At least one form element
|
275
|
+
# assert_select "form"
|
276
|
+
#
|
277
|
+
# # Form element includes four input fields
|
278
|
+
# assert_select "form input", 4
|
279
|
+
#
|
280
|
+
# # Page title is "Welcome"
|
281
|
+
# assert_select "title", "Welcome"
|
282
|
+
#
|
283
|
+
# # Page title is "Welcome" and there is only one title element
|
284
|
+
# assert_select "title", {count: 1, text: "Welcome"},
|
285
|
+
# "Wrong title or more than one title element"
|
286
|
+
#
|
287
|
+
# # Page contains no forms
|
288
|
+
# assert_select "form", false, "This page must contain no forms"
|
289
|
+
#
|
290
|
+
# # Test the content and style
|
291
|
+
# assert_select "body div.header ul.menu"
|
292
|
+
#
|
293
|
+
# # Use substitution values
|
294
|
+
# assert_select "ol>li:match('id', ?)", /item-\d+/
|
295
|
+
#
|
296
|
+
# # All input fields in the form have a name
|
297
|
+
# assert_select "form input" do
|
298
|
+
# assert_select ":match('name', ?)", /.+/ # Not empty
|
299
|
+
# end
|
300
|
+
#
|
301
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#161
|
90
302
|
def assert_select(*args, &block); end
|
303
|
+
|
304
|
+
# Extracts the body of an email and runs nested assertions on it.
|
305
|
+
#
|
306
|
+
# You must enable deliveries for this assertion to work, use:
|
307
|
+
# ActionMailer::Base.perform_deliveries = true
|
308
|
+
#
|
309
|
+
# assert_select_email do
|
310
|
+
# assert_select "h1", "Email alert"
|
311
|
+
# end
|
312
|
+
#
|
313
|
+
# assert_select_email do
|
314
|
+
# items = assert_select "ol>li"
|
315
|
+
# items.each do
|
316
|
+
# # Work with items here...
|
317
|
+
# end
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#247
|
91
321
|
def assert_select_email(&block); end
|
322
|
+
|
323
|
+
# Extracts the content of an element, treats it as encoded HTML and runs
|
324
|
+
# nested assertion on it.
|
325
|
+
#
|
326
|
+
# You typically call this method within another assertion to operate on
|
327
|
+
# all currently selected elements. You can also pass an element or array
|
328
|
+
# of elements.
|
329
|
+
#
|
330
|
+
# The content of each element is un-encoded, and wrapped in the root
|
331
|
+
# element +encoded+. It then calls the block with all un-encoded elements.
|
332
|
+
#
|
333
|
+
# # Selects all bold tags from within the title of an Atom feed's entries (perhaps to nab a section name prefix)
|
334
|
+
# assert_select "feed[xmlns='http://www.w3.org/2005/Atom']" do
|
335
|
+
# # Select each entry item and then the title item
|
336
|
+
# assert_select "entry>title" do
|
337
|
+
# # Run assertions on the encoded title elements
|
338
|
+
# assert_select_encoded do
|
339
|
+
# assert_select "b"
|
340
|
+
# end
|
341
|
+
# end
|
342
|
+
# end
|
343
|
+
#
|
344
|
+
#
|
345
|
+
# # Selects all paragraph tags from within the description of an RSS feed
|
346
|
+
# assert_select "rss[version=2.0]" do
|
347
|
+
# # Select description element of each feed item.
|
348
|
+
# assert_select "channel>item>description" do
|
349
|
+
# # Run assertions on the encoded elements.
|
350
|
+
# assert_select_encoded do
|
351
|
+
# assert_select "p"
|
352
|
+
# end
|
353
|
+
# end
|
354
|
+
# end
|
355
|
+
#
|
356
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#211
|
92
357
|
def assert_select_encoded(element = T.unsafe(nil), &block); end
|
358
|
+
|
359
|
+
# Select and return all matching elements.
|
360
|
+
#
|
361
|
+
# If called with a single argument, uses that argument as a selector.
|
362
|
+
# Called without an element +css_select+ selects from
|
363
|
+
# the element returned in +document_root_element+
|
364
|
+
#
|
365
|
+
# The default implementation of +document_root_element+ raises an exception explaining this.
|
366
|
+
#
|
367
|
+
# Returns an empty Nokogiri::XML::NodeSet if no match is found.
|
368
|
+
#
|
369
|
+
# If called with two arguments, uses the first argument as the root
|
370
|
+
# element and the second argument as the selector. Attempts to match the
|
371
|
+
# root element and any of its children.
|
372
|
+
# Returns an empty Nokogiri::XML::NodeSet if no match is found.
|
373
|
+
#
|
374
|
+
# The selector may be a CSS selector expression (String).
|
375
|
+
# css_select returns nil if called with an invalid css selector.
|
376
|
+
#
|
377
|
+
# # Selects all div tags
|
378
|
+
# divs = css_select("div")
|
379
|
+
#
|
380
|
+
# # Selects all paragraph tags and does something interesting
|
381
|
+
# pars = css_select("p")
|
382
|
+
# pars.each do |par|
|
383
|
+
# # Do something fun with paragraphs here...
|
384
|
+
# end
|
385
|
+
#
|
386
|
+
# # Selects all list items in unordered lists
|
387
|
+
# items = css_select("ul>li")
|
388
|
+
#
|
389
|
+
# # Selects all form tags and then all inputs inside the form
|
390
|
+
# forms = css_select("form")
|
391
|
+
# forms.each do |form|
|
392
|
+
# inputs = css_select(form, "input")
|
393
|
+
# ...
|
394
|
+
# end
|
395
|
+
#
|
396
|
+
# @raise [ArgumentError]
|
397
|
+
#
|
398
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#59
|
93
399
|
def css_select(*args); end
|
94
400
|
|
95
401
|
private
|
96
402
|
|
403
|
+
# +equals+ must contain :minimum, :maximum and :count keys
|
404
|
+
#
|
405
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#270
|
97
406
|
def assert_size_match!(size, equals, css_selector, message = T.unsafe(nil)); end
|
407
|
+
|
408
|
+
# @raise [NotImplementedError]
|
409
|
+
#
|
410
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#264
|
98
411
|
def document_root_element; end
|
412
|
+
|
413
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#282
|
99
414
|
def nest_selection(selection); end
|
415
|
+
|
416
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#291
|
100
417
|
def nodeset(node); end
|
101
418
|
end
|
102
419
|
|
420
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#8
|
103
421
|
module Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
104
|
-
extend
|
105
|
-
|
422
|
+
extend ::ActiveSupport::Concern
|
106
423
|
|
107
424
|
private
|
108
425
|
|
426
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#12
|
109
427
|
def count_description(min, max, count); end
|
428
|
+
|
429
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#24
|
110
430
|
def pluralize_element(quantity); end
|
111
431
|
end
|
112
432
|
|
433
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#1
|
113
434
|
class SubstitutionContext
|
435
|
+
# @return [SubstitutionContext] a new instance of SubstitutionContext
|
436
|
+
#
|
437
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#2
|
114
438
|
def initialize; end
|
115
439
|
|
440
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#16
|
116
441
|
def match(matches, attribute, matcher); end
|
442
|
+
|
443
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#6
|
117
444
|
def substitute!(selector, values, format_for_presentation = T.unsafe(nil)); end
|
118
445
|
|
119
446
|
private
|
120
447
|
|
448
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#21
|
121
449
|
def matcher_for(value, format_for_presentation); end
|
450
|
+
|
451
|
+
# @return [Boolean]
|
452
|
+
#
|
453
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#30
|
122
454
|
def substitutable?(value); end
|
123
455
|
end
|