diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/secure_random_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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 |