Skip to content

Commit aa84a78

Browse files
committed
ruby-head: handle unused block warnings
Ref: https://bugs.ruby-lang.org/issues/15554 This new Ruby 3.4 warning is still being fined tuned to reduce false positives, so we shouldn't fail builds on it just yet. It however caught one mistake in the test suite which is valuable.
1 parent 64fadc6 commit aa84a78

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)