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
3mix-castronaut-0.5.0.2 spec/castronaut/utilities/random_string_spec.rb
masover-castronaut-0.4.4.4 spec/castronaut/utilities/random_string_spec.rb
masover-castronaut-0.4.4.5 spec/castronaut/utilities/random_string_spec.rb
masover-castronaut-0.5.0.1 spec/castronaut/utilities/random_string_spec.rb
p8-castronaut-0.6.1.1 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.2.0 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.2.5 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.3.0 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.3.5 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.3.6 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.1 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.2 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.3 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.4 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.5 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.4.6 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.5.0 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.5.1 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.5.2 spec/castronaut/utilities/random_string_spec.rb
relevance-castronaut-0.5.3 spec/castronaut/utilities/random_string_spec.rb