Fix Active Support test warnings

The namespace ivar needs a definition check to not warn on Ruby 2.7
This commit is contained in:
Hartley McGuire 2023-11-28 20:32:47 -05:00
parent d64acfdcac
commit e67b8d0dcc
No known key found for this signature in database
GPG Key ID: E823FC1403858A82
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ module CacheLoggingBehavior
assert_match pattern, io.string
end
def key_pattern(key, namespace: @namespace)
def key_pattern(key, namespace: defined?(@namespace) && @namespace)
/#{Regexp.escape namespace.to_s}#{":" if namespace}#{Regexp.escape key}/
end
end