spec/unit/yaks/null_resource_spec.rb in yaks-0.6.0 vs spec/unit/yaks/null_resource_spec.rb in yaks-0.6.1
- old
+ new
@@ -27,6 +27,30 @@
context 'when a collection' do
subject(:null_resource) { described_class.new( collection: true ) }
its(:collection?) { should be true }
end
+
+ it 'should not allow updating attributes' do
+ expect { null_resource.update_attributes({}) }.to raise_error(
+ Yaks::UnsupportedOperationError, "Operation update_attributes not supported on Yaks::NullResource"
+ )
+ end
+
+ it 'should not allow adding links' do
+ expect { null_resource.add_link(nil) }.to raise_error(
+ Yaks::UnsupportedOperationError, "Operation add_link not supported on Yaks::NullResource"
+ )
+ end
+
+ it 'should not allow adding controls' do
+ expect { null_resource.add_control(nil) }.to raise_error(
+ Yaks::UnsupportedOperationError, "Operation add_control not supported on Yaks::NullResource"
+ )
+ end
+
+ it 'should not allow adding subresources' do
+ expect { null_resource.add_subresource(nil, nil) }.to raise_error(
+ Yaks::UnsupportedOperationError, "Operation add_subresource not supported on Yaks::NullResource"
+ )
+ end
end