Skip to content

Commit 57cbc2e

Browse files
authored
Merge pull request rails#51583 from Shopify/ruby-3.4-block-warnings
ruby-head: handle unused block warnings
2 parents b846080 + aa84a78 commit 57cbc2e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

activesupport/lib/active_support/testing/strict_warnings.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ module RaiseWarnings # :nodoc:
1212
# Expected non-verbose warning emitted by Rails.
1313
/Ignoring .*\.yml because it has expired/,
1414
/Failed to validate the schema cache because/,
15+
16+
# Ref: https://bugs.ruby-lang.org/issues/15554
17+
# This new Ruby 3.4 warning is still being fined tuned to reduce false positives
18+
/the block passed to/,
1519
)
1620

1721
SUPPRESSED_WARNINGS = Regexp.union(

activesupport/test/time_travel_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,12 @@ def test_time_helper_with_usec_true
332332

333333
def test_time_helper_freeze_time_with_usec_true
334334
# repeatedly test in case Time.now happened to actually be 0 usec
335-
assert_predicate 9.times, :any? do
335+
checks = 9.times.map do
336336
freeze_time(with_usec: true) do
337337
Time.now.usec != 0
338338
end
339339
end
340+
assert_predicate checks, :any?
340341
end
341342

342343
def test_time_helper_travel_with_subsequent_block

0 commit comments

Comments
 (0)