test/lib/vedeu/repositories/store_test.rb in vedeu-0.8.6 vs test/lib/vedeu/repositories/store_test.rb in vedeu-0.8.7
- old
+ new
@@ -28,10 +28,18 @@
let(:described) { Vedeu::Repositories::Store }
let(:instance) { Vedeu::Repositories::StoreTestClass.new(model, storage) }
let(:model) {}
let(:storage) {}
+ describe '#all' do
+ it { instance.must_respond_to(:all) }
+ end
+
+ describe '#clear' do
+ it { instance.must_respond_to(:clear) }
+ end
+
describe '#each' do
subject { instance.each }
it { subject.must_be_instance_of(Enumerator) }
end
@@ -53,12 +61,12 @@
describe '#exists?' do
let(:_name) {}
subject { instance.exists?(_name) }
- context 'when empty' do
- let(:_name) { 'terbium' }
+ context 'when the store is empty' do
+ let(:_name) { :vedeu_repositories_store }
it { subject.must_equal(false) }
end
context 'with no name' do
@@ -128,30 +136,10 @@
subject.must_equal([])
end
end
end
- describe '#reset' do
- before { Vedeu.stubs(:log) }
-
- it 'returns a Hash' do
- instance.reset.must_be_instance_of(Hash)
- end
-
- it 'resets the repository' do
- instance.reset.must_equal({})
- end
- end
-
- describe '#reset!' do
- it { instance.must_respond_to(:reset!) }
- end
-
- describe '#clear' do
- it { instance.must_respond_to(:clear) }
- end
-
describe '#size' do
subject { instance.size }
context 'when empty' do
it { subject.must_equal(0) }
@@ -160,15 +148,9 @@
context 'when not empty' do
let(:storage) { [:item] }
it { subject.must_equal(1) }
end
- end
-
- describe '#storage' do
- subject { instance.storage }
-
- it { subject.must_equal({}) }
end
describe '#all' do
it { instance.must_respond_to(:all) }
end