Sha256: c543d7b3f4e9cd4b757b3771762ff943317bd1d968841888fa1f9d50a39aa080

Contents?: true

Size: 469 Bytes

Versions: 3

Compression:

Stored size: 469 Bytes

Contents

require 'spec_helper'

describe Object do
  it "returns 8 a's if only a is given as character list" do
    new_token(8, ['a']).should == 'aaaaaaaa'
  end

  it "returns 'bbbbbbbb' if random_number retruns 1" do
    SecureRandom.stub(:random_number).and_return(1)
    new_token.should == 'bbbbbbbb'
  end

  it "returns a random string with the given length" do
    32.times do |i|
      100.times do
        new_token(i).length.should == i
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ar-tokens-0.0.6 spec/object_spec.rb
ar-tokens-0.0.5 spec/object_spec.rb
ar-tokens-0.0.4 spec/object_spec.rb