Sha256: 7d240b8debb25750c8ddb4d922e2b852ac938ff9bd6bdb98c6bee03ae77d1da7

Contents?: true

Size: 541 Bytes

Versions: 40

Compression:

Stored size: 541 Bytes

Contents

require 'helper'

class TestRandom < ActiveSupport::TestCase
  include Challah
  
  should "be able to provide a random string from ActiveSupport" do
    result = Random.token(10)
    
    assert_not_nil result
    assert_equal 10, result.size
  end
  
  should "be able to provide a random string without ActiveSupport" do
    Challah::Random.stubs(:secure_random?).returns(false)    
    SecureRandom.expects(:hex).never
    
    result = Challah::Random.token(10)
    
    assert_not_nil result
    assert_equal 10, result.size
  end 
end

Version data entries

40 entries across 39 versions & 2 rubygems

Version Path
challah-1.1.0 test/random_test.rb
challah-1.0.0 test/random_test.rb
challah-1.0.0.beta3 test/random_test.rb
challah-1.0.0.beta2 test/random_test.rb
challah-1.0.0.beta test/random_test.rb
challah-0.9.1.beta.3 test/random_test.rb
challah-0.9.1.beta.2 test/random_test.rb
challah-0.9.1.beta test/random_test.rb
challah-0.9.0 test/random_test.rb
challah-0.9.0.pre test/random_test.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/test/random_test.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/test/random_test.rb
challah-0.8.3 test/random_test.rb
challah-0.8.2 test/random_test.rb
challah-0.8.1 test/random_test.rb
challah-0.8.0 test/random_test.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/test/random_test.rb
challah-0.8.0.pre test/random_test.rb
challah-0.7.1 test/random_test.rb
challah-0.7.0 test/random_test.rb