Sha256: 89691a8867f9350434fad27e45ce31089405d0545f0e40541cfa4e008fed5436

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

require 'pwm'

describe Pwm do
  context 'The default set of characters' do
    it 'should include all upper-case letters' do
      ('A'..'Z').each do |letter|
        Pwm.characters.should include(letter)
      end
    end
    it 'should include all lower-case letters' do
      ('a'..'z').each do |letter|
        Pwm.characters.should include(letter)
      end
    end
    it 'should include all digits 2 through 9' do
      ('2'..'9').each do |letter|
        Pwm.characters.should include(letter)
      end
    end
  end

  context 'The password method' do
    context 'when given a length' do
      it 'should generate a password of that length' do
        Pwm.password(8).length.should == 8
      end
    end
    context 'when not given a length' do
      it 'should generate a 16-character password' do
        Pwm.password.length.should == 16
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pwm-1.0.0 spec/pwm_spec.rb