Sha256: 390cd8c794a0a5691dc4e8460ec6234444c1db306695fe5589b71cf383f7402a

Contents?: true

Size: 597 Bytes

Versions: 5

Compression:

Stored size: 597 Bytes

Contents

require 'rubygems'
lib_path = (Pathname(__FILE__).dirname.parent.expand_path + 'lib').to_s
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)

require 'ixtlan/passwords'

describe Ixtlan::Passwords do

  it 'should create a password of given length' do
    pwd = Ixtlan::Passwords.generate(123)
    ((pwd =~ /[a-z]/) && (pwd =~ /[A-Z]/) && (pwd =~ /[!-;]/)).should be_true
    pwd.size.should == 123
  end

  it 'should create a numeric password of given length' do
    pwd = Ixtlan::Passwords.generate_numeric(321)
    pwd.should =~ /^[0-9]*$/
    pwd.size.should == 321
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ixtlan-0.4.3 spec/passwords_spec.rb
ixtlan-0.4.2 spec/passwords_spec.rb
ixtlan-0.4.1 spec/passwords_spec.rb
ixtlan-0.4.0 spec/passwords_spec.rb
ixtlan-0.4.0.pre5 spec/passwords_spec.rb