Sha256: bddf899c7b65b5ec5f1428033164c81d2bee68257ad4d81cee6cfd6dd931af87

Contents?: true

Size: 829 Bytes

Versions: 4

Compression:

Stored size: 829 Bytes

Contents

require 'sham/data'

describe Sham do
  context '#string!' do
    it 'should be a string' do
      described_class.string!.should be_an_instance_of(String)
    end

    it 'should have a length of 10' do
      described_class.string!.length.should == 10
    end

    it 'should allow different lengths' do
      described_class.string!(10).length.should == 20
    end
  end

  context '#integer!' do
    it 'should be an integer' do
      described_class.integer!.should \
        be_an_instance_of(Fixnum)
    end

    it 'should be between 0 and 100' do
      10.times do
        described_class.integer!.should satisfy{ |x| x >= 0 && x < 100 }
      end
    end

    it 'should allow a differnet top' do
      10.times do
        described_class.integer!(10).should satisfy{ |x| x >= 0 && x < 10 }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sham-2.0.0 spec/lib/sham/data_spec.rb
sham-1.2.0 spec/lib/sham/data_spec.rb
sham-1.1.0 spec/lib/sham/data_spec.rb
sham-1.0.3 spec/lib/sham/data_spec.rb