blob: 799ac2a87b750c16c0841b3764678bccd3a3cda9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
require 'abstract_unit'
class SecureRandomTest < Test::Unit::TestCase
def test_random_bytes
b1 = SecureRandom.random_bytes(64)
b2 = SecureRandom.random_bytes(64)
assert_not_equal b1, b2
end
def test_hex
b1 = SecureRandom.hex(64)
b2 = SecureRandom.hex(64)
assert_not_equal b1, b2
end
def test_random_number
assert SecureRandom.random_number(5000) < 5000
end
end
|