spec/hammerstore_spec.rb in hammerstore-0.0.2 vs spec/hammerstore_spec.rb in hammerstore-1.0.0
- old
+ new
@@ -1,18 +1,16 @@
require 'spec_helper'
-require 'set'
describe HammerStore do
describe '#new' do
it 'creates store objects' do
test = HammerStore.new file: 'teststore'
expect(test).to be_an_instance_of HammerStore::Store
end
end
describe HammerStore::Store do
- let(:keys) { [1, 2, 3, 4, 5, :foo, 'foo'].to_set }
let(:store) do
store = HammerStore::Store.new file: 'teststore'
store.clear!
(1..5).each { |i| store[i] = i + 5 }
store[:foo] = :bar
@@ -56,16 +54,16 @@
expect(store.size).to eql 7
end
end
describe '#include?' do
it 'checks for a key in the store' do
- expect(store.include? :fish).to be_false
- expect(store.include? 1).to be_true
+ expect(store.include? :fish).to be_falsey
+ expect(store.include? 1).to be_truthy
end
end
describe '#keys' do
it 'lists the keys in the store' do
- expect(store.keys.to_set).to eql keys
+ expect(store.keys).to match_array [1, 2, 3, 4, 5, :foo, 'foo']
end
end
end
end