Feature #10849 » test_securerandom.patch
| test/test_securerandom.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_choose
|
||
|
65.times do |idx|
|
||
|
ch = @it.choose([*'a'..'e', *'0'..'5'])
|
||
|
assert_match(/^[a-e0-5]+$/, ch)
|
||
|
end
|
||
|
end
|
||
|
def test_graph
|
||
|
65.times do |idx|
|
||
|
g = @it.graph
|
||
|
assert_match(/^[!-~]+$/, g)
|
||
|
end
|
||
|
end
|
||
|
def test_alphanumeric
|
||
|
65.times do |idx|
|
||
|
an = @it.alphanumeric
|
||
|
assert_match(/^[0-9a-zA-Z]+$/, an)
|
||
|
end
|
||
|
end
|
||
|
def protect
|
||
|
begin
|
||
|
yield
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »