aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/cache/behaviors/cache_store_behavior.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-04-13 13:46:53 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2018-04-13 13:46:53 +0900
commit57fe81200f1b645acd62ec004b4664944a3fbf68 (patch)
treee733d32ed6f77602df545935f5cc927d98a1355a /activesupport/test/cache/behaviors/cache_store_behavior.rb
parent4a68792df7f2cecf9e6d9ddb18dfe761f553eb2a (diff)
downloadrails-57fe81200f1b645acd62ec004b4664944a3fbf68.tar.gz
rails-57fe81200f1b645acd62ec004b4664944a3fbf68.tar.bz2
rails-57fe81200f1b645acd62ec004b4664944a3fbf68.zip
Use `SecureRandom.random_bytes` instead of `SecureRandom.bytes`
`SecureRandom.byes` was added in Ruby 2.4. So, 5-2-stable build is broken because using `SecureRandom.bytes`. https://travis-ci.org/rails/rails/jobs/365740667 Also, `SecureRandom.byes` seems to an undocumented method. If need random binary strings, should use `SecureRandom.random_bytes`. https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb
Diffstat (limited to 'activesupport/test/cache/behaviors/cache_store_behavior.rb')
-rw-r--r--activesupport/test/cache/behaviors/cache_store_behavior.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/test/cache/behaviors/cache_store_behavior.rb b/activesupport/test/cache/behaviors/cache_store_behavior.rb
index 0806665c27..e2146a1b3a 100644
--- a/activesupport/test/cache/behaviors/cache_store_behavior.rb
+++ b/activesupport/test/cache/behaviors/cache_store_behavior.rb
@@ -241,7 +241,7 @@ module CacheStoreBehavior
# generate an incompressible string
loop do
- incompressible = SecureRandom.bytes(1.kilobyte)
+ incompressible = SecureRandom.random_bytes(1.kilobyte)
break if incompressible.bytesize < Zlib::Deflate.deflate(incompressible).bytesize
end