Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1dfebd4f0d
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (16 sloc) 0.479 kb
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
def test_random_number
assert ActiveSupport::SecureRandom.random_number(5000) < 5000
end
end
Jump to Line
Something went wrong with that request. Please try again.