From b3411ff59eb1e1c31f98f58f117a2ffaaf0c3ff5 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion" Date: Wed, 27 Aug 2008 12:42:08 +0200 Subject: Deprecate Rails::SecretKeyGenerator in favor of ActiveSupport::SecureRandom. SecureRandom has a few minor security enhancements and can be used as a drop-in replacement Signed-off-by: Michael Koziarski [#913 state:committed] --- activesupport/test/secure_random_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 activesupport/test/secure_random_test.rb (limited to 'activesupport/test/secure_random_test.rb') diff --git a/activesupport/test/secure_random_test.rb b/activesupport/test/secure_random_test.rb new file mode 100644 index 0000000000..b0b6c21a81 --- /dev/null +++ b/activesupport/test/secure_random_test.rb @@ -0,0 +1,15 @@ +require 'abstract_unit' + +class SecureRandomTest < Test::Unit::TestCase + def test_random_bytes + b1 = ActiveSupport::SecureRandom.random_bytes(64) + b2 = ActiveSupport::SecureRandom.random_bytes(64) + assert_not_equal b1, b2 + end + + def test_hex + b1 = ActiveSupport::SecureRandom.hex(64) + b2 = ActiveSupport::SecureRandom.hex(64) + assert_not_equal b1, b2 + end +end -- cgit v1.2.3