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