From 57fe81200f1b645acd62ec004b4664944a3fbf68 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Fri, 13 Apr 2018 13:46:53 +0900 Subject: 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 --- activesupport/test/cache/behaviors/cache_store_behavior.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/test/cache') 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 -- cgit v1.2.3