test/lib/vedeu/repositories/repository_test.rb in vedeu-0.4.40 vs test/lib/vedeu/repositories/repository_test.rb in vedeu-0.4.41

- old
+ new

@@ -44,18 +44,10 @@ let(:model) { Vedeu::TestModel } let(:model_instance) { model.new(model_name) } let(:model_name) { 'terbium' } let(:storage) { {} } - describe 'alias methods' do - it { instance.must_respond_to(:by_name) } - it { instance.must_respond_to(:destroy) } - it { instance.must_respond_to(:delete) } - it { instance.must_respond_to(:deregister) } - it { instance.must_respond_to(:register) } - end - describe '#initialize' do 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 @@ -92,10 +84,18 @@ it { subject.must_equal([:hydrogen, :helium]) } end end end + describe '#by_name' do + let(:_name) {} + + subject { instance.by_name(_name) } + + # it { skip } + end + describe '#current' do subject { instance.current } # it { skip } # it { subject.must_equal('') } @@ -182,11 +182,11 @@ after { Vedeu.interfaces.reset } subject { Vedeu.interfaces.inspect } it { subject.must_equal( - "<Vedeu::InterfacesRepository: [\"hydrogen\", \"helium\"]>" + "<Vedeu::Interfaces: [\"hydrogen\", \"helium\"]>" ) } end end describe '#registered' do @@ -248,10 +248,14 @@ end describe '#remove' do subject { instance.remove('francium') } + it { instance.must_respond_to(:destroy) } + it { instance.must_respond_to(:delete) } + it { instance.must_respond_to(:deregister) } + context 'when the storage is empty' do before { instance.reset } it { subject.must_be_instance_of(FalseClass) } end @@ -278,9 +282,11 @@ end end describe '#store' do subject { instance.store(model_instance) } + + 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(MissingRequired) }