aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/test/secure_random_test.rb
blob: b0b6c21a81b4a407019497a3b2a81015710f8262 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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