Sha256: b0dd2529b32995f86a2ab98ecbf3561f02dddb52b43216ae17b955b688e2d679

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

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

Version data entries

7 entries across 6 versions & 4 rubygems

Version Path
kajam-1.0.3.rc2 vendor/rails/activesupport/test/secure_random_test.rb
radiant-1.0.0.rc2 vendor/rails/activesupport/test/secure_random_test.rb
radiant-1.0.0.rc1 vendor/rails/activesupport/test/secure_random_test.rb
radiant-0.9.0.rc2 vendor/rails/activesupport/test/secure_random_test.rb
usher-0.7.0 spec/rails2_2/vendor/rails/vendor/rails/activesupport/test/secure_random_test.rb
usher-0.7.0 spec/rails2_3/vendor/rails/vendor/rails/activesupport/test/secure_random_test.rb
recliner-0.0.1 vendor/activesupport/test/secure_random_test.rb