Skip to content

Commit 0df09dd

Browse files
authored
Merge pull request rails#53162 from Shopify/ruby-head-fixes
Fix tests to pass on ruby-head
2 parents ced8607 + a7b18a3 commit 0df09dd

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

activemodel/test/cases/type/date_time_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_hash_to_time
3434
def test_hash_with_wrong_keys
3535
type = Type::DateTime.new
3636
error = assert_raises(ArgumentError) { type.cast(a: 1) }
37-
assert_equal "Provided hash {:a=>1} doesn't contain necessary keys: [1, 2, 3]", error.message
37+
assert_equal "Provided hash #{{ a: 1 }} doesn't contain necessary keys: [1, 2, 3]", error.message
3838
end
3939

4040
test "serialize_cast_value is equivalent to serialize after cast" do

railties/test/commands/routes_test.rb

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
243243
run_routes_command([ "--expanded" ])
244244
end
245245

246+
# Normalize the output
247+
output.gsub!(/\.rb:\d+$/, ".rb:XX")
248+
output.gsub!(/ \([\d.]+\) /, " (X.X.X) ")
249+
246250
rails_gem_root = File.expand_path("../../../../", __FILE__)
247251

248252
# rubocop:disable Layout/TrailingWhitespace
@@ -252,151 +256,151 @@ class Rails::Command::RoutesTest < ActiveSupport::TestCase
252256
Verb |
253257
URI | /assets
254258
Controller#Action | Propshaft::Server
255-
Source Location | propshaft (1.0.0) lib/propshaft/railtie.rb:43
259+
Source Location | propshaft (X.X.X) lib/propshaft/railtie.rb:XX
256260
--[ Route 2 ]--------------
257261
Prefix | cart
258262
Verb | GET
259263
URI | /cart(.:format)
260264
Controller#Action | cart#show
261-
Source Location | #{app_path}/config/routes.rb:2
265+
Source Location | #{app_path}/config/routes.rb:XX
262266
--[ Route 3 ]--------------
263267
Prefix | rails_postmark_inbound_emails
264268
Verb | POST
265269
URI | /rails/action_mailbox/postmark/inbound_emails(.:format)
266270
Controller#Action | action_mailbox/ingresses/postmark/inbound_emails#create
267-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:5
271+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
268272
--[ Route 4 ]--------------
269273
Prefix | rails_relay_inbound_emails
270274
Verb | POST
271275
URI | /rails/action_mailbox/relay/inbound_emails(.:format)
272276
Controller#Action | action_mailbox/ingresses/relay/inbound_emails#create
273-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:6
277+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
274278
--[ Route 5 ]--------------
275279
Prefix | rails_sendgrid_inbound_emails
276280
Verb | POST
277281
URI | /rails/action_mailbox/sendgrid/inbound_emails(.:format)
278282
Controller#Action | action_mailbox/ingresses/sendgrid/inbound_emails#create
279-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:7
283+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
280284
--[ Route 6 ]--------------
281285
Prefix | rails_mandrill_inbound_health_check
282286
Verb | GET
283287
URI | /rails/action_mailbox/mandrill/inbound_emails(.:format)
284288
Controller#Action | action_mailbox/ingresses/mandrill/inbound_emails#health_check
285-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:10
289+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
286290
--[ Route 7 ]--------------
287291
Prefix | rails_mandrill_inbound_emails
288292
Verb | POST
289293
URI | /rails/action_mailbox/mandrill/inbound_emails(.:format)
290294
Controller#Action | action_mailbox/ingresses/mandrill/inbound_emails#create
291-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:11
295+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
292296
--[ Route 8 ]--------------
293297
Prefix | rails_mailgun_inbound_emails
294298
Verb | POST
295299
URI | /rails/action_mailbox/mailgun/inbound_emails/mime(.:format)
296300
Controller#Action | action_mailbox/ingresses/mailgun/inbound_emails#create
297-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:14
301+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
298302
--[ Route 9 ]--------------
299303
Prefix | rails_conductor_inbound_emails
300304
Verb | GET
301305
URI | /rails/conductor/action_mailbox/inbound_emails(.:format)
302306
Controller#Action | rails/conductor/action_mailbox/inbound_emails#index
303-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:19
307+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
304308
--[ Route 10 ]-------------
305309
Prefix |#{" "}
306310
Verb | POST
307311
URI | /rails/conductor/action_mailbox/inbound_emails(.:format)
308312
Controller#Action | rails/conductor/action_mailbox/inbound_emails#create
309-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:19
313+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
310314
--[ Route 11 ]-------------
311315
Prefix | new_rails_conductor_inbound_email
312316
Verb | GET
313317
URI | /rails/conductor/action_mailbox/inbound_emails/new(.:format)
314318
Controller#Action | rails/conductor/action_mailbox/inbound_emails#new
315-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:19
319+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
316320
--[ Route 12 ]-------------
317321
Prefix | rails_conductor_inbound_email
318322
Verb | GET
319323
URI | /rails/conductor/action_mailbox/inbound_emails/:id(.:format)
320324
Controller#Action | rails/conductor/action_mailbox/inbound_emails#show
321-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:19
325+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
322326
--[ Route 13 ]-------------
323327
Prefix | new_rails_conductor_inbound_email_source
324328
Verb | GET
325329
URI | /rails/conductor/action_mailbox/inbound_emails/sources/new(.:format)
326330
Controller#Action | rails/conductor/action_mailbox/inbound_emails/sources#new
327-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:20
331+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
328332
--[ Route 14 ]-------------
329333
Prefix | rails_conductor_inbound_email_sources
330334
Verb | POST
331335
URI | /rails/conductor/action_mailbox/inbound_emails/sources(.:format)
332336
Controller#Action | rails/conductor/action_mailbox/inbound_emails/sources#create
333-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:21
337+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
334338
--[ Route 15 ]-------------
335339
Prefix | rails_conductor_inbound_email_reroute
336340
Verb | POST
337341
URI | /rails/conductor/action_mailbox/:inbound_email_id/reroute(.:format)
338342
Controller#Action | rails/conductor/action_mailbox/reroutes#create
339-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:23
343+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
340344
--[ Route 16 ]-------------
341345
Prefix | rails_conductor_inbound_email_incinerate
342346
Verb | POST
343347
URI | /rails/conductor/action_mailbox/:inbound_email_id/incinerate(.:format)
344348
Controller#Action | rails/conductor/action_mailbox/incinerates#create
345-
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:24
349+
Source Location | #{rails_gem_root}/actionmailbox/config/routes.rb:XX
346350
--[ Route 17 ]-------------
347351
Prefix | rails_service_blob
348352
Verb | GET
349353
URI | /rails/active_storage/blobs/redirect/:signed_id/*filename(.:format)
350354
Controller#Action | active_storage/blobs/redirect#show
351-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:5
355+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
352356
--[ Route 18 ]-------------
353357
Prefix | rails_service_blob_proxy
354358
Verb | GET
355359
URI | /rails/active_storage/blobs/proxy/:signed_id/*filename(.:format)
356360
Controller#Action | active_storage/blobs/proxy#show
357-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:6
361+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
358362
--[ Route 19 ]-------------
359363
Prefix |#{" "}
360364
Verb | GET
361365
URI | /rails/active_storage/blobs/:signed_id/*filename(.:format)
362366
Controller#Action | active_storage/blobs/redirect#show
363-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:7
367+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
364368
--[ Route 20 ]-------------
365369
Prefix | rails_blob_representation
366370
Verb | GET
367371
URI | /rails/active_storage/representations/redirect/:signed_blob_id/:variation_key/*filename(.:format)
368372
Controller#Action | active_storage/representations/redirect#show
369-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:9
373+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
370374
--[ Route 21 ]-------------
371375
Prefix | rails_blob_representation_proxy
372376
Verb | GET
373377
URI | /rails/active_storage/representations/proxy/:signed_blob_id/:variation_key/*filename(.:format)
374378
Controller#Action | active_storage/representations/proxy#show
375-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:10
379+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
376380
--[ Route 22 ]-------------
377381
Prefix |#{" "}
378382
Verb | GET
379383
URI | /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format)
380384
Controller#Action | active_storage/representations/redirect#show
381-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:11
385+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
382386
--[ Route 23 ]-------------
383387
Prefix | rails_disk_service
384388
Verb | GET
385389
URI | /rails/active_storage/disk/:encoded_key/*filename(.:format)
386390
Controller#Action | active_storage/disk#show
387-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:13
391+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
388392
--[ Route 24 ]-------------
389393
Prefix | update_rails_disk_service
390394
Verb | PUT
391395
URI | /rails/active_storage/disk/:encoded_token(.:format)
392396
Controller#Action | active_storage/disk#update
393-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:14
397+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
394398
--[ Route 25 ]-------------
395399
Prefix | rails_direct_uploads
396400
Verb | POST
397401
URI | /rails/active_storage/direct_uploads(.:format)
398402
Controller#Action | active_storage/direct_uploads#create
399-
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:15
403+
Source Location | #{rails_gem_root}/activestorage/config/routes.rb:XX
400404
MESSAGE
401405
# rubocop:enable Layout/TrailingWhitespace
402406
end

0 commit comments

Comments
 (0)