rails_type_id 0.1.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 (124) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +25 -0
  3. data/.ruby-version +1 -0
  4. data/README.md +46 -0
  5. data/Rakefile +16 -0
  6. data/lib/rails_type_id/concern.rb +129 -0
  7. data/lib/rails_type_id/require.rb +6 -0
  8. data/lib/rails_type_id/test_helper.rb +16 -0
  9. data/lib/rails_type_id/version.rb +6 -0
  10. data/lib/rails_type_id.rb +9 -0
  11. data/lib/tapioca/dsl/compilers/rails_type_id_compiler.rb +49 -0
  12. data/sig/rails_type_id.rbs +4 -0
  13. data/sorbet/config +4 -0
  14. data/sorbet/rbi/annotations/.gitattributes +1 -0
  15. data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
  16. data/sorbet/rbi/annotations/actionpack.rbi +430 -0
  17. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  18. data/sorbet/rbi/annotations/activejob.rbi +44 -0
  19. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  20. data/sorbet/rbi/annotations/activerecord.rbi +98 -0
  21. data/sorbet/rbi/annotations/activesupport.rbi +468 -0
  22. data/sorbet/rbi/annotations/globalid.rbi +30 -0
  23. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  24. data/sorbet/rbi/annotations/railties.rbi +61 -0
  25. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  26. data/sorbet/rbi/dsl/.gitattributes +1 -0
  27. data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +21 -0
  28. data/sorbet/rbi/dsl/active_model/validations.rbi +26 -0
  29. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  30. data/sorbet/rbi/dsl/rails_type_id/concern.rbi +22 -0
  31. data/sorbet/rbi/gems/.gitattributes +1 -0
  32. data/sorbet/rbi/gems/actioncable@8.0.2.rbi +3133 -0
  33. data/sorbet/rbi/gems/actionmailbox@8.0.2.rbi +991 -0
  34. data/sorbet/rbi/gems/actionmailer@8.0.2.rbi +2775 -0
  35. data/sorbet/rbi/gems/actionpack@8.0.2.rbi +21167 -0
  36. data/sorbet/rbi/gems/actiontext@8.0.2.rbi +1449 -0
  37. data/sorbet/rbi/gems/actionview@8.0.2.rbi +15789 -0
  38. data/sorbet/rbi/gems/activejob@8.0.2.rbi +2864 -0
  39. data/sorbet/rbi/gems/activemodel@8.0.2.rbi +6946 -0
  40. data/sorbet/rbi/gems/activerecord@8.0.2.rbi +42458 -0
  41. data/sorbet/rbi/gems/activestorage@8.0.2.rbi +2156 -0
  42. data/sorbet/rbi/gems/activesupport@8.0.2.rbi +21274 -0
  43. data/sorbet/rbi/gems/ast@2.4.3.rbi +586 -0
  44. data/sorbet/rbi/gems/base64@0.3.0.rbi +545 -0
  45. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  46. data/sorbet/rbi/gems/bigdecimal@3.2.2.rbi +275 -0
  47. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  48. data/sorbet/rbi/gems/concurrent-ruby@1.3.5.rbi +11734 -0
  49. data/sorbet/rbi/gems/connection_pool@2.5.3.rbi +9 -0
  50. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  51. data/sorbet/rbi/gems/date@3.4.1.rbi +403 -0
  52. data/sorbet/rbi/gems/drb@2.2.3.rbi +1661 -0
  53. data/sorbet/rbi/gems/erb@5.0.2.rbi +878 -0
  54. data/sorbet/rbi/gems/erubi@1.13.1.rbi +157 -0
  55. data/sorbet/rbi/gems/globalid@1.2.1.rbi +742 -0
  56. data/sorbet/rbi/gems/i18n@1.14.7.rbi +2383 -0
  57. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  58. data/sorbet/rbi/gems/json@2.12.2.rbi +2287 -0
  59. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  60. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +323 -0
  61. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  62. data/sorbet/rbi/gems/loofah@2.24.1.rbi +1105 -0
  63. data/sorbet/rbi/gems/mail@2.8.1.rbi +8890 -0
  64. data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
  65. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
  66. data/sorbet/rbi/gems/minitest@5.25.5.rbi +2231 -0
  67. data/sorbet/rbi/gems/net-imap@0.5.9.rbi +10285 -0
  68. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
  69. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  70. data/sorbet/rbi/gems/net-smtp@0.5.1.rbi +1240 -0
  71. data/sorbet/rbi/gems/netrc@0.11.0.rbi +177 -0
  72. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +388 -0
  73. data/sorbet/rbi/gems/nokogiri@1.18.9.rbi +8548 -0
  74. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  75. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5537 -0
  76. data/sorbet/rbi/gems/pp@0.6.2.rbi +368 -0
  77. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  78. data/sorbet/rbi/gems/prism@1.4.0.rbi +41790 -0
  79. data/sorbet/rbi/gems/psych@5.2.6.rbi +2542 -0
  80. data/sorbet/rbi/gems/racc@1.8.1.rbi +168 -0
  81. data/sorbet/rbi/gems/rack-session@2.1.1.rbi +722 -0
  82. data/sorbet/rbi/gems/rack-test@2.2.0.rbi +729 -0
  83. data/sorbet/rbi/gems/rack@3.2.0.rbi +5054 -0
  84. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  85. data/sorbet/rbi/gems/rails-dom-testing@2.3.0.rbi +790 -0
  86. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.2.rbi +645 -0
  87. data/sorbet/rbi/gems/rails@8.0.2.rbi +9 -0
  88. data/sorbet/rbi/gems/railties@8.0.2.rbi +4014 -0
  89. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  90. data/sorbet/rbi/gems/rake@13.3.0.rbi +3039 -0
  91. data/sorbet/rbi/gems/rbi@0.3.6.rbi +5162 -0
  92. data/sorbet/rbi/gems/rbs@4.0.0.dev.4.rbi +7895 -0
  93. data/sorbet/rbi/gems/rdoc@6.14.2.rbi +12944 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3833 -0
  95. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  96. data/sorbet/rbi/gems/require-hooks@0.2.2.rbi +110 -0
  97. data/sorbet/rbi/gems/rexml@3.4.1.rbi +5205 -0
  98. data/sorbet/rbi/gems/rubocop-ast@1.46.0.rbi +7473 -0
  99. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  100. data/sorbet/rbi/gems/rubocop@1.79.1.rbi +63674 -0
  101. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  102. data/sorbet/rbi/gems/securerandom@0.4.1.rbi +75 -0
  103. data/sorbet/rbi/gems/spoom@1.7.5.rbi +5832 -0
  104. data/sorbet/rbi/gems/sqlite3@2.7.3.rbi +1989 -0
  105. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  106. data/sorbet/rbi/gems/tapioca@0.17.7.rbi +3692 -0
  107. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  108. data/sorbet/rbi/gems/timeout@0.4.3.rbi +157 -0
  109. data/sorbet/rbi/gems/typeid@0.2.2.rbi +239 -0
  110. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5919 -0
  111. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +132 -0
  112. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +251 -0
  113. data/sorbet/rbi/gems/uri@1.0.3.rbi +2354 -0
  114. data/sorbet/rbi/gems/useragent@0.16.11.rbi +9 -0
  115. data/sorbet/rbi/gems/uuid7@0.2.0.rbi +60 -0
  116. data/sorbet/rbi/gems/websocket-driver@0.8.0.rbi +1065 -0
  117. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +117 -0
  118. data/sorbet/rbi/gems/with_model@2.2.0.rbi +282 -0
  119. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +430 -0
  120. data/sorbet/rbi/gems/yard@0.9.37.rbi +18512 -0
  121. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1196 -0
  122. data/sorbet/tapioca/config.yml +13 -0
  123. data/sorbet/tapioca/require.rb +13 -0
  124. metadata +208 -0
@@ -0,0 +1,729 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rack-test` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rack-test`.
6
+
7
+
8
+ # source://rack-test//lib/rack/test/cookie_jar.rb#6
9
+ module Rack; end
10
+
11
+ # For backwards compatibility with 1.1.0 and below
12
+ #
13
+ # source://rack-test//lib/rack/test.rb#381
14
+ Rack::MockSession = Rack::Test::Session
15
+
16
+ # source://rack-test//lib/rack/test/cookie_jar.rb#7
17
+ module Rack::Test
18
+ class << self
19
+ # Whether the version of rack in use handles encodings.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # source://rack-test//lib/rack/test.rb#375
24
+ def encoding_aware_strings?; end
25
+ end
26
+ end
27
+
28
+ # Represents individual cookies in the cookie jar. This is considered private
29
+ # API and behavior of this class can change at any time.
30
+ #
31
+ # source://rack-test//lib/rack/test/cookie_jar.rb#10
32
+ class Rack::Test::Cookie
33
+ include ::Rack::Utils
34
+
35
+ # @return [Cookie] a new instance of Cookie
36
+ #
37
+ # source://rack-test//lib/rack/test/cookie_jar.rb#23
38
+ def initialize(raw, uri = T.unsafe(nil), default_host = T.unsafe(nil)); end
39
+
40
+ # Order cookies by name, path, and domain.
41
+ #
42
+ # source://rack-test//lib/rack/test/cookie_jar.rb#106
43
+ def <=>(other); end
44
+
45
+ # The explicit or implicit domain for the cookie.
46
+ #
47
+ # source://rack-test//lib/rack/test/cookie_jar.rb#59
48
+ def domain; end
49
+
50
+ # Whether the cookie has a value.
51
+ #
52
+ # @return [Boolean]
53
+ #
54
+ # source://rack-test//lib/rack/test/cookie_jar.rb#54
55
+ def empty?; end
56
+
57
+ # Whether the cookie is currently expired.
58
+ #
59
+ # @return [Boolean]
60
+ #
61
+ # source://rack-test//lib/rack/test/cookie_jar.rb#86
62
+ def expired?; end
63
+
64
+ # A Time value for when the cookie expires, if the expires option is set.
65
+ #
66
+ # source://rack-test//lib/rack/test/cookie_jar.rb#81
67
+ def expires; end
68
+
69
+ # Whether the cookie has the httponly flag, indicating it is not available via
70
+ # a javascript API.
71
+ #
72
+ # @return [Boolean]
73
+ #
74
+ # source://rack-test//lib/rack/test/cookie_jar.rb#71
75
+ def http_only?; end
76
+
77
+ # Cookies that do not match the URI will not be sent in requests to the URI.
78
+ #
79
+ # @return [Boolean]
80
+ #
81
+ # source://rack-test//lib/rack/test/cookie_jar.rb#101
82
+ def matches?(uri); end
83
+
84
+ # The name of the cookie, will be a string
85
+ #
86
+ # source://rack-test//lib/rack/test/cookie_jar.rb#14
87
+ def name; end
88
+
89
+ # The explicit or implicit path for the cookie.
90
+ #
91
+ # source://rack-test//lib/rack/test/cookie_jar.rb#76
92
+ def path; end
93
+
94
+ # The raw string for the cookie, without options. Will generally be in
95
+ # name=value format is name and value are provided.
96
+ #
97
+ # source://rack-test//lib/rack/test/cookie_jar.rb#21
98
+ def raw; end
99
+
100
+ # Wether the given cookie can replace the current cookie in the cookie jar.
101
+ #
102
+ # @return [Boolean]
103
+ #
104
+ # source://rack-test//lib/rack/test/cookie_jar.rb#49
105
+ def replaces?(other); end
106
+
107
+ # Whether the cookie has the secure flag, indicating it can only be sent over
108
+ # an encrypted connection.
109
+ #
110
+ # @return [Boolean]
111
+ #
112
+ # source://rack-test//lib/rack/test/cookie_jar.rb#65
113
+ def secure?; end
114
+
115
+ # A hash of cookie options, including the cookie value, but excluding the cookie name.
116
+ #
117
+ # source://rack-test//lib/rack/test/cookie_jar.rb#111
118
+ def to_h; end
119
+
120
+ # A hash of cookie options, including the cookie value, but excluding the cookie name.
121
+ #
122
+ # source://rack-test//lib/rack/test/cookie_jar.rb#120
123
+ def to_hash; end
124
+
125
+ # Whether the cookie is valid for the given URI.
126
+ #
127
+ # @return [Boolean]
128
+ #
129
+ # source://rack-test//lib/rack/test/cookie_jar.rb#91
130
+ def valid?(uri); end
131
+
132
+ # The value of the cookie, will be a string or nil if there is no value.
133
+ #
134
+ # source://rack-test//lib/rack/test/cookie_jar.rb#17
135
+ def value; end
136
+
137
+ private
138
+
139
+ # The default URI to use for the cookie, including just the host.
140
+ #
141
+ # source://rack-test//lib/rack/test/cookie_jar.rb#125
142
+ def default_uri; end
143
+ end
144
+
145
+ # Represents all cookies for a session, handling adding and
146
+ # removing cookies, and finding which cookies apply to a given
147
+ # request. This is considered private API and behavior of this
148
+ # class can change at any time.
149
+ #
150
+ # source://rack-test//lib/rack/test/cookie_jar.rb#134
151
+ class Rack::Test::CookieJar
152
+ # @return [CookieJar] a new instance of CookieJar
153
+ #
154
+ # source://rack-test//lib/rack/test/cookie_jar.rb#137
155
+ def initialize(cookies = T.unsafe(nil), default_host = T.unsafe(nil)); end
156
+
157
+ # Add a Cookie to the cookie jar.
158
+ #
159
+ # source://rack-test//lib/rack/test/cookie_jar.rb#197
160
+ def <<(new_cookie); end
161
+
162
+ # Return the value for first cookie with the given name, or nil
163
+ # if no such cookie exists.
164
+ #
165
+ # source://rack-test//lib/rack/test/cookie_jar.rb#150
166
+ def [](name); end
167
+
168
+ # Set a cookie with the given name and value in the
169
+ # cookie jar.
170
+ #
171
+ # source://rack-test//lib/rack/test/cookie_jar.rb#160
172
+ def []=(name, value); end
173
+
174
+ # Delete all cookies with the given name from the cookie jar.
175
+ #
176
+ # source://rack-test//lib/rack/test/cookie_jar.rb#174
177
+ def delete(name); end
178
+
179
+ # Return a raw cookie string for the cookie header to
180
+ # use for the given URI.
181
+ #
182
+ # source://rack-test//lib/rack/test/cookie_jar.rb#208
183
+ def for(uri); end
184
+
185
+ # Return the first cookie with the given name, or nil if
186
+ # no such cookie exists.
187
+ #
188
+ # source://rack-test//lib/rack/test/cookie_jar.rb#166
189
+ def get_cookie(name); end
190
+
191
+ # Add a string of raw cookie information to the cookie jar,
192
+ # if the cookie is valid for the given URI.
193
+ # Cookies should be separated with a newline.
194
+ #
195
+ # source://rack-test//lib/rack/test/cookie_jar.rb#184
196
+ def merge(raw_cookies, uri = T.unsafe(nil)); end
197
+
198
+ # Return a hash cookie names and cookie values for cookies in the jar.
199
+ #
200
+ # source://rack-test//lib/rack/test/cookie_jar.rb#225
201
+ def to_hash; end
202
+
203
+ private
204
+
205
+ # Yield each cookie that matches for the URI.
206
+ #
207
+ # The cookies are sorted by most specific first. So, we loop through
208
+ # all the cookies in order and add it to a hash by cookie name if
209
+ # the cookie can be sent to the current URI. It's added to the hash
210
+ # so that when we are done, the cookies will be unique by name and
211
+ # we'll have grabbed the most specific to the URI.
212
+ #
213
+ # source://rack-test//lib/rack/test/cookie_jar.rb#244
214
+ def each_cookie_for(uri); end
215
+
216
+ # Ensure the copy uses a distinct cookies array.
217
+ #
218
+ # source://rack-test//lib/rack/test/cookie_jar.rb#143
219
+ def initialize_copy(other); end
220
+ end
221
+
222
+ # source://rack-test//lib/rack/test/cookie_jar.rb#135
223
+ Rack::Test::CookieJar::DELIMITER = T.let(T.unsafe(nil), String)
224
+
225
+ # The default host to use for requests, when a full URI is not
226
+ # provided.
227
+ #
228
+ # source://rack-test//lib/rack/test.rb#33
229
+ Rack::Test::DEFAULT_HOST = T.let(T.unsafe(nil), String)
230
+
231
+ # The ending boundary in multipart requests
232
+ #
233
+ # source://rack-test//lib/rack/test.rb#42
234
+ Rack::Test::END_BOUNDARY = T.let(T.unsafe(nil), String)
235
+
236
+ # The common base class for exceptions raised by Rack::Test
237
+ #
238
+ # source://rack-test//lib/rack/test.rb#45
239
+ class Rack::Test::Error < ::StandardError; end
240
+
241
+ # The default multipart boundary to use for multipart request bodies
242
+ #
243
+ # source://rack-test//lib/rack/test.rb#36
244
+ Rack::Test::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String)
245
+
246
+ # This module serves as the primary integration point for using Rack::Test
247
+ # in a testing environment. It depends on an app method being defined in the
248
+ # same context, and provides the Rack::Test API methods (see Rack::Test::Session
249
+ # for their documentation). It defines the following methods that are delegated
250
+ # to the current session: :request, :get, :post, :put, :patch, :delete, :options,
251
+ # :head, :custom_request, :follow_redirect!, :header, :env, :set_cookie,
252
+ # :clear_cookies, :authorize, :basic_authorize, :last_response, and :last_request.
253
+ #
254
+ # Example:
255
+ #
256
+ # class HomepageTest < Test::Unit::TestCase
257
+ # include Rack::Test::Methods
258
+ #
259
+ # def app
260
+ # MyApp
261
+ # end
262
+ # end
263
+ #
264
+ # source://rack-test//lib/rack/test/methods.rb#24
265
+ module Rack::Test::Methods
266
+ extend ::Forwardable
267
+
268
+ # Private accessor to avoid uninitialized instance variable warning in Ruby 2.*
269
+ #
270
+ # source://rack-test//lib/rack/test/methods.rb#90
271
+ def _rack_test_current_session=(_arg0); end
272
+
273
+ # source://rack-test//lib/rack/test/methods.rb#68
274
+ def authorize(*args, **_arg1, &block); end
275
+
276
+ # source://rack-test//lib/rack/test/methods.rb#68
277
+ def basic_authorize(*args, **_arg1, &block); end
278
+
279
+ # Create a new Rack::Test::Session for #app.
280
+ #
281
+ # source://rack-test//lib/rack/test/methods.rb#40
282
+ def build_rack_test_session(_name); end
283
+
284
+ # source://rack-test//lib/rack/test/methods.rb#68
285
+ def clear_cookies(*args, **_arg1, &block); end
286
+
287
+ # Return the currently actively session. This is the session to
288
+ # which the delegated methods are sent.
289
+ #
290
+ # source://rack-test//lib/rack/test/methods.rb#55
291
+ def current_session; end
292
+
293
+ # source://rack-test//lib/rack/test/methods.rb#68
294
+ def custom_request(*args, **_arg1, &block); end
295
+
296
+ # source://rack-test//lib/rack/test/methods.rb#68
297
+ def delete(*args, **_arg1, &block); end
298
+
299
+ # source://rack-test//lib/rack/test/methods.rb#68
300
+ def env(*args, **_arg1, &block); end
301
+
302
+ # source://rack-test//lib/rack/test/methods.rb#68
303
+ def follow_redirect!(*args, **_arg1, &block); end
304
+
305
+ # source://rack-test//lib/rack/test/methods.rb#68
306
+ def get(*args, **_arg1, &block); end
307
+
308
+ # source://rack-test//lib/rack/test/methods.rb#68
309
+ def head(*args, **_arg1, &block); end
310
+
311
+ # source://rack-test//lib/rack/test/methods.rb#68
312
+ def header(*args, **_arg1, &block); end
313
+
314
+ # source://rack-test//lib/rack/test/methods.rb#68
315
+ def last_request(*args, **_arg1, &block); end
316
+
317
+ # source://rack-test//lib/rack/test/methods.rb#68
318
+ def last_response(*args, **_arg1, &block); end
319
+
320
+ # source://rack-test//lib/rack/test/methods.rb#68
321
+ def options(*args, **_arg1, &block); end
322
+
323
+ # source://rack-test//lib/rack/test/methods.rb#68
324
+ def patch(*args, **_arg1, &block); end
325
+
326
+ # source://rack-test//lib/rack/test/methods.rb#68
327
+ def post(*args, **_arg1, &block); end
328
+
329
+ # source://rack-test//lib/rack/test/methods.rb#68
330
+ def put(*args, **_arg1, &block); end
331
+
332
+ # Return the existing session with the given name, or a new
333
+ # rack session. Always use a new session if name is nil.
334
+ # For backwards compatibility with older rack-test versions.
335
+ #
336
+ # source://rack-test//lib/rack/test/methods.rb#37
337
+ def rack_mock_session(name = T.unsafe(nil)); end
338
+
339
+ # Return the existing session with the given name, or a new
340
+ # rack session. Always use a new session if name is nil.
341
+ #
342
+ # source://rack-test//lib/rack/test/methods.rb#29
343
+ def rack_test_session(name = T.unsafe(nil)); end
344
+
345
+ # source://rack-test//lib/rack/test/methods.rb#68
346
+ def request(*args, **_arg1, &block); end
347
+
348
+ # source://rack-test//lib/rack/test/methods.rb#68
349
+ def set_cookie(*args, **_arg1, &block); end
350
+
351
+ # Create a new session (or reuse an existing session with the given name),
352
+ # and make it the current session for the given block.
353
+ #
354
+ # source://rack-test//lib/rack/test/methods.rb#61
355
+ def with_session(name); end
356
+
357
+ private
358
+
359
+ # Private accessor to avoid uninitialized instance variable warning in Ruby 2.*
360
+ #
361
+ # source://rack-test//lib/rack/test/methods.rb#90
362
+ def _rack_test_current_session; end
363
+ end
364
+
365
+ # The starting boundary in multipart requests
366
+ #
367
+ # source://rack-test//lib/rack/test.rb#39
368
+ Rack::Test::START_BOUNDARY = T.let(T.unsafe(nil), String)
369
+
370
+ # Rack::Test::Session handles a series of requests issued to a Rack app.
371
+ # It keeps track of the cookies for the session, and allows for setting headers
372
+ # and a default rack environment that is used for future requests.
373
+ #
374
+ # Rack::Test::Session's methods are most often called through Rack::Test::Methods,
375
+ # which will automatically build a session when it's first used.
376
+ #
377
+ # source://rack-test//lib/rack/test.rb#53
378
+ class Rack::Test::Session
379
+ include ::Rack::Utils
380
+ include ::Rack::Test::Utils
381
+ extend ::Forwardable
382
+
383
+ # Creates a Rack::Test::Session for a given Rack app or Rack::Test::BasicSession.
384
+ #
385
+ # Note: Generally, you won't need to initialize a Rack::Test::Session directly.
386
+ # Instead, you should include Rack::Test::Methods into your testing context.
387
+ # (See README.rdoc for an example)
388
+ #
389
+ # The following methods are defined via metaprogramming: get, post, put, patch,
390
+ # delete, options, and head. Each method submits a request with the given request
391
+ # method, with the given URI and optional parameters and rack environment.
392
+ # Examples:
393
+ #
394
+ # # URI only:
395
+ # get("/") # GET /
396
+ # get("/?foo=bar") # GET /?foo=bar
397
+ #
398
+ # # URI and parameters
399
+ # get("/foo", 'bar'=>'baz') # GET /foo?bar=baz
400
+ # post("/foo", 'bar'=>'baz') # POST /foo (bar=baz in request body)
401
+ #
402
+ # # URI, parameters, and rack environment
403
+ # get("/bar", {}, 'CONTENT_TYPE'=>'foo')
404
+ # get("/bar", {'foo'=>'baz'}, 'HTTP_ACCEPT'=>'*')
405
+ #
406
+ # The above methods as well as #request and #custom_request store the Rack::Request
407
+ # submitted in #last_request. The methods store a Rack::MockResponse based on the
408
+ # response in #last_response. #last_response is also returned by the methods.
409
+ # If a block is given, #last_response is also yielded to the block.
410
+ #
411
+ # @return [Session] a new instance of Session
412
+ #
413
+ # source://rack-test//lib/rack/test.rb#99
414
+ def initialize(app, default_host = T.unsafe(nil)); end
415
+
416
+ # Run a block after the each request completes.
417
+ #
418
+ # source://rack-test//lib/rack/test.rb#118
419
+ def after_request(&block); end
420
+
421
+ # Set the username and password for HTTP Basic authorization, to be
422
+ # included in subsequent requests in the HTTP_AUTHORIZATION header.
423
+ #
424
+ # Example:
425
+ # basic_authorize "bryan", "secret"
426
+ #
427
+ # source://rack-test//lib/rack/test.rb#203
428
+ def authorize(username, password); end
429
+
430
+ # Set the username and password for HTTP Basic authorization, to be
431
+ # included in subsequent requests in the HTTP_AUTHORIZATION header.
432
+ #
433
+ # Example:
434
+ # basic_authorize "bryan", "secret"
435
+ #
436
+ # source://rack-test//lib/rack/test.rb#198
437
+ def basic_authorize(username, password); end
438
+
439
+ # Replace the current cookie jar with an empty cookie jar.
440
+ #
441
+ # source://rack-test//lib/rack/test.rb#123
442
+ def clear_cookies; end
443
+
444
+ # The Rack::Test::CookieJar for the cookies for the current session.
445
+ #
446
+ # source://rack-test//lib/rack/test.rb#67
447
+ def cookie_jar; end
448
+
449
+ # The Rack::Test::CookieJar for the cookies for the current session.
450
+ #
451
+ # source://rack-test//lib/rack/test.rb#67
452
+ def cookie_jar=(_arg0); end
453
+
454
+ # Issue a request using the given HTTP verb for the given URI, with optional
455
+ # params and rack environment. Example:
456
+ #
457
+ # custom_request "LINK", "/"
458
+ #
459
+ # source://rack-test//lib/rack/test.rb#160
460
+ def custom_request(verb, uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
461
+
462
+ # The default host used for the session for when using paths for URIs.
463
+ #
464
+ # source://rack-test//lib/rack/test.rb#70
465
+ def default_host; end
466
+
467
+ # source://rack-test//lib/rack/test.rb#110
468
+ def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
469
+
470
+ # Set an entry in the rack environment to be included on all subsequent
471
+ # requests through the session. Use a value of nil to remove a previously
472
+ # value. Example:
473
+ #
474
+ # env "rack.session", {:csrf => 'token'}
475
+ #
476
+ # source://rack-test//lib/rack/test.rb#185
477
+ def env(name, value); end
478
+
479
+ # Rack::Test will not follow any redirects automatically. This method
480
+ # will follow the redirect returned (including setting the Referer header
481
+ # on the new request) in the last response. If the last response was not
482
+ # a redirect, an error will be raised.
483
+ #
484
+ # source://rack-test//lib/rack/test.rb#209
485
+ def follow_redirect!; end
486
+
487
+ # source://rack-test//lib/rack/test.rb#110
488
+ def get(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
489
+
490
+ # source://rack-test//lib/rack/test.rb#110
491
+ def head(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
492
+
493
+ # Set a header to be included on all subsequent requests through the
494
+ # session. Use a value of nil to remove a previously configured header.
495
+ #
496
+ # In accordance with the Rack spec, headers will be included in the Rack
497
+ # environment hash in HTTP_USER_AGENT form. Example:
498
+ #
499
+ # header "user-agent", "Firefox"
500
+ #
501
+ # source://rack-test//lib/rack/test.rb#173
502
+ def header(name, value); end
503
+
504
+ # Return the last request issued in the session. Raises an error if no
505
+ # requests have been sent yet.
506
+ #
507
+ # @raise [Error]
508
+ #
509
+ # source://rack-test//lib/rack/test.rb#134
510
+ def last_request; end
511
+
512
+ # Return the last response received in the session. Raises an error if
513
+ # no requests have been sent yet.
514
+ #
515
+ # @raise [Error]
516
+ #
517
+ # source://rack-test//lib/rack/test.rb#141
518
+ def last_response; end
519
+
520
+ # source://rack-test//lib/rack/test.rb#110
521
+ def options(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
522
+
523
+ # source://rack-test//lib/rack/test.rb#110
524
+ def patch(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
525
+
526
+ # source://rack-test//lib/rack/test.rb#110
527
+ def post(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
528
+
529
+ # source://rack-test//lib/rack/test.rb#110
530
+ def put(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end
531
+
532
+ # Issue a request to the Rack app for the given URI and optional Rack
533
+ # environment. Example:
534
+ #
535
+ # request "/"
536
+ #
537
+ # source://rack-test//lib/rack/test.rb#150
538
+ def request(uri, env = T.unsafe(nil), &block); end
539
+
540
+ # Yield to the block, and restore the last request, last response, and
541
+ # cookie jar to the state they were prior to block execution upon
542
+ # exiting the block.
543
+ #
544
+ # source://rack-test//lib/rack/test.rb#240
545
+ def restore_state; end
546
+
547
+ # Set a cookie in the current cookie jar.
548
+ #
549
+ # source://rack-test//lib/rack/test.rb#128
550
+ def set_cookie(cookie, uri = T.unsafe(nil)); end
551
+
552
+ private
553
+
554
+ # Append a string version of the query params to the array of query params.
555
+ #
556
+ # source://rack-test//lib/rack/test.rb#340
557
+ def append_query_params(query_array, query_params); end
558
+
559
+ # close() gets called automatically in newer Rack versions.
560
+ #
561
+ # source://rack-test//lib/rack/test.rb#266
562
+ def close_body(body); end
563
+
564
+ # Update environment to use based on given URI.
565
+ #
566
+ # source://rack-test//lib/rack/test.rb#293
567
+ def env_for(uri, env); end
568
+
569
+ # Return the multipart content type to use based on the environment.
570
+ #
571
+ # source://rack-test//lib/rack/test.rb#346
572
+ def multipart_content_type(env); end
573
+
574
+ # Normalize URI based on given URI/path and environment.
575
+ #
576
+ # source://rack-test//lib/rack/test.rb#271
577
+ def parse_uri(path, env); end
578
+
579
+ # Submit the request with the given URI and rack environment to
580
+ # the mock session. Returns and potentially yields the last response.
581
+ #
582
+ # @yield [@last_response]
583
+ #
584
+ # source://rack-test//lib/rack/test.rb#357
585
+ def process_request(uri, env); end
586
+
587
+ class << self
588
+ # source://rack-test//lib/rack/test.rb#57
589
+ def new(app, default_host = T.unsafe(nil)); end
590
+ end
591
+ end
592
+
593
+ # source://rack-test//lib/rack/test.rb#279
594
+ Rack::Test::Session::DEFAULT_ENV = T.let(T.unsafe(nil), Hash)
595
+
596
+ # Wraps a Tempfile with a content type. Including one or more UploadedFile's
597
+ # in the params causes Rack::Test to build and issue a multipart request.
598
+ #
599
+ # Example:
600
+ # post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg")
601
+ #
602
+ # source://rack-test//lib/rack/test/uploaded_file.rb#14
603
+ class Rack::Test::UploadedFile
604
+ # Creates a new UploadedFile instance.
605
+ #
606
+ # Arguments:
607
+ # content :: is a path to a file, or an {IO} or {StringIO} object representing the content.
608
+ # content_type :: MIME type of the file
609
+ # binary :: Whether the file should be set to binmode (content treated as binary).
610
+ # original_filename :: The filename to use for the file. Required if content is StringIO, optional override if not
611
+ #
612
+ # @return [UploadedFile] a new instance of UploadedFile
613
+ #
614
+ # source://rack-test//lib/rack/test/uploaded_file.rb#31
615
+ def initialize(content, content_type = T.unsafe(nil), binary = T.unsafe(nil), original_filename: T.unsafe(nil)); end
616
+
617
+ # Append to given buffer in 64K chunks to avoid multiple large
618
+ # copies of file data in memory. Rewind tempfile before and
619
+ # after to make sure all data in tempfile is appended to the
620
+ # buffer.
621
+ #
622
+ # source://rack-test//lib/rack/test/uploaded_file.rb#60
623
+ def append_to(buffer); end
624
+
625
+ # The content type of the "uploaded" file
626
+ #
627
+ # source://rack-test//lib/rack/test/uploaded_file.rb#22
628
+ def content_type; end
629
+
630
+ # The content type of the "uploaded" file
631
+ #
632
+ # source://rack-test//lib/rack/test/uploaded_file.rb#22
633
+ def content_type=(_arg0); end
634
+
635
+ # The path to the tempfile. Will not work if the receiver's content is from a StringIO.
636
+ #
637
+ # source://rack-test//lib/rack/test/uploaded_file.rb#49
638
+ def local_path; end
639
+
640
+ # Delegate all methods not handled to the tempfile.
641
+ #
642
+ # source://rack-test//lib/rack/test/uploaded_file.rb#52
643
+ def method_missing(method_name, *args, &block); end
644
+
645
+ # The filename, *not* including the path, of the "uploaded" file
646
+ #
647
+ # source://rack-test//lib/rack/test/uploaded_file.rb#16
648
+ def original_filename; end
649
+
650
+ # The path to the tempfile. Will not work if the receiver's content is from a StringIO.
651
+ #
652
+ # source://rack-test//lib/rack/test/uploaded_file.rb#46
653
+ def path; end
654
+
655
+ # The tempfile
656
+ #
657
+ # source://rack-test//lib/rack/test/uploaded_file.rb#19
658
+ def tempfile; end
659
+
660
+ private
661
+
662
+ # Create a tempfile and copy the content from the given path into the tempfile, optionally renaming if
663
+ # original_filename has been set.
664
+ #
665
+ # source://rack-test//lib/rack/test/uploaded_file.rb#86
666
+ def initialize_from_file_path(path); end
667
+
668
+ # Use the StringIO as the tempfile.
669
+ #
670
+ # @raise [ArgumentError]
671
+ #
672
+ # source://rack-test//lib/rack/test/uploaded_file.rb#78
673
+ def initialize_from_stringio(stringio); end
674
+
675
+ # @return [Boolean]
676
+ #
677
+ # source://rack-test//lib/rack/test/uploaded_file.rb#71
678
+ def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end
679
+ end
680
+
681
+ # source://rack-test//lib/rack/test/utils.rb#5
682
+ module Rack::Test::Utils
683
+ include ::Rack::Utils
684
+ extend ::Rack::Utils
685
+ extend ::Rack::Test::Utils
686
+
687
+ # Build a multipart body for the given params.
688
+ #
689
+ # @raise [ArgumentError]
690
+ #
691
+ # source://rack-test//lib/rack/test/utils.rb#34
692
+ def build_multipart(params, _first = T.unsafe(nil), multipart = T.unsafe(nil)); end
693
+
694
+ # Build a query string for the given value and prefix. The value
695
+ # can be an array or hash of parameters.
696
+ #
697
+ # source://rack-test//lib/rack/test/utils.rb#11
698
+ def build_nested_query(value, prefix = T.unsafe(nil)); end
699
+
700
+ private
701
+
702
+ # Append each multipart parameter value to the buffer.
703
+ #
704
+ # source://rack-test//lib/rack/test/utils.rb#100
705
+ def _build_parts(buffer, parameters); end
706
+
707
+ # Append the multipart fragment for a parameter that is a file upload to the buffer.
708
+ #
709
+ # source://rack-test//lib/rack/test/utils.rb#133
710
+ def build_file_part(buffer, parameter_name, uploaded_file); end
711
+
712
+ # Build the multipart content for uploading.
713
+ #
714
+ # source://rack-test//lib/rack/test/utils.rb#94
715
+ def build_parts(buffer, parameters); end
716
+
717
+ # Append the multipart fragment for a parameter that isn't a file upload to the buffer.
718
+ #
719
+ # source://rack-test//lib/rack/test/utils.rb#121
720
+ def build_primitive_part(buffer, parameter_name, value); end
721
+
722
+ # Return a flattened hash of parameter values based on the given params.
723
+ #
724
+ # source://rack-test//lib/rack/test/utils.rb#62
725
+ def normalize_multipart_params(params, first = T.unsafe(nil)); end
726
+ end
727
+
728
+ # source://rack-test//lib/rack/test/version.rb#3
729
+ Rack::Test::VERSION = T.let(T.unsafe(nil), String)