test/BigHash_spec.rb in perobs-4.1.0 vs test/BigHash_spec.rb in perobs-4.2.0
- old
+ new
@@ -70,10 +70,17 @@
expect(@h['foo']).to eql('bar')
expect(@h.length).to eql(1)
expect(@h.keys).to eql([ 'foo' ])
end
+ it 'should store a few objects' do
+ 20.times do |i|
+ @h["bar#{i}"] = "foo#{i}"
+ end
+ expect(@h.size).to eql(20)
+ end
+
it 'should return nil for unknown objects' do
expect(@h['bar']).to be_nil
end
it 'should be able to store values with hash collisions' do
@@ -125,9 +132,10 @@
n.times do |i|
h["key#{i}"] = 2 * i
end
expect(h.check).to be true
expect(h.length).to eql(n)
+ expect(store.check).to eql(0)
store.exit
store = PEROBS::Store.new(db_name)
expect(store.check).to eql(0)
h = store['hash']