Skip to content

Commit e67b8d0

Browse files
committed
Fix Active Support test warnings
The namespace ivar needs a definition check to not warn on Ruby 2.7
1 parent d64acfd commit e67b8d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/test/cache/behaviors/cache_logging_behavior.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def assert_logs(pattern, &block)
7777
assert_match pattern, io.string
7878
end
7979

80-
def key_pattern(key, namespace: @namespace)
80+
def key_pattern(key, namespace: defined?(@namespace) && @namespace)
8181
/#{Regexp.escape namespace.to_s}#{":" if namespace}#{Regexp.escape key}/
8282
end
8383
end

0 commit comments

Comments
 (0)