Skip to content

Commit

Permalink
ruby-head: handle unused block warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
byroot committed Apr 17, 2024
1 parent 64fadc6 commit aa84a78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions activesupport/lib/active_support/testing/strict_warnings.rb
Expand Up @@ -12,6 +12,10 @@ module RaiseWarnings # :nodoc:
# Expected non-verbose warning emitted by Rails.
/Ignoring .*\.yml because it has expired/,
/Failed to validate the schema cache because/,

# Ref: https://bugs.ruby-lang.org/issues/15554
# This new Ruby 3.4 warning is still being fined tuned to reduce false positives
/the block passed to/,
)

SUPPRESSED_WARNINGS = Regexp.union(
Expand Down
3 changes: 2 additions & 1 deletion activesupport/test/time_travel_test.rb
Expand Up @@ -332,11 +332,12 @@ def test_time_helper_with_usec_true

def test_time_helper_freeze_time_with_usec_true
# repeatedly test in case Time.now happened to actually be 0 usec
assert_predicate 9.times, :any? do
checks = 9.times.map do
freeze_time(with_usec: true) do
Time.now.usec != 0
end
end
assert_predicate checks, :any?
end

def test_time_helper_travel_with_subsequent_block
Expand Down

0 comments on commit aa84a78

Please sign in to comment.