test/lib/vedeu/repositories/repository_test.rb in vedeu-0.7.4 vs test/lib/vedeu/repositories/repository_test.rb in vedeu-0.8.0

- old
+ new

@@ -52,12 +52,15 @@ it { instance.must_be_instance_of(described) } it { instance.instance_variable_get('@model').must_equal(model) } it { instance.instance_variable_get('@storage').must_equal(storage) } end - describe 'accessors' do + describe '#model' do it { instance.must_respond_to(:model) } + end + + describe '#storage' do it { instance.must_respond_to(:storage) } end describe '#all' do subject { instance.all } @@ -216,12 +219,10 @@ end describe '#remove' do subject { instance.remove('francium') } - it { instance.must_respond_to(:delete) } - context 'when the storage is empty' do before { instance.reset } it { subject.must_be_instance_of(FalseClass) } end @@ -246,17 +247,19 @@ subject.size.must_equal(1) end end end + describe '#delete' do + it { instance.must_respond_to(:delete) } + end + describe '#store' do subject { instance.store(model_instance) } before { Vedeu.stubs(:log) } - it { instance.must_respond_to(:register) } - context 'when a name attribute is empty or nil' do before { model_instance.name = '' } it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) } end @@ -264,9 +267,13 @@ context 'when a name attributes is provided' do let(:model_name) { 'hydrogen' } it { subject.must_be_instance_of(Vedeu::Repositories::TestModel) } end + end + + describe '#register' do + it { instance.must_respond_to(:register) } end end # Repository end # Repositories