Sha256: 996e8a3639a8bf1d79541011accfdab5d75f187933a445c7f0aef926fd8d809f

Contents?: true

Size: 443 Bytes

Versions: 27

Compression:

Stored size: 443 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_helper'))

describe Castronaut::Utilities::RandomString do

  it "generates random string with a given length using ISAAC" do
    isaac = stub(:rand => "123")
    ::Crypt::ISAAC.should_receive(:new).and_return(isaac)

    isaac.should_receive(:rand).with(4_294_619_050).exactly(8).times.and_return("123")

    Castronaut::Utilities::RandomString.generate
  end

end

Version data entries

27 entries across 27 versions & 6 rubygems

Version Path
relevance-castronaut-0.5.4 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.6.0 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.6.1 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.7.4 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.7.5 spec/castronaut/utilities/random_string_spec.rb
nbudin-castronaut-0.7.5 spec/castronaut/utilities/random_string_spec.rb
factorylabs-castronaut-0.7.5 spec/castronaut/utilities/random_string_spec.rb