spec/spec_helper.rb in fuelsdk-0.1.0 vs spec/spec_helper.rb in fuelsdk-0.1.1

- old
+ new

@@ -10,5 +10,53 @@ config.color_enabled = true # Use the specified formatter config.formatter = :documentation end + +shared_examples_for 'Response Object' do + it { should respond_to(:code) } + it { should respond_to(:message) } + it { should respond_to(:results) } + it { should respond_to(:request_id) } + it { should respond_to(:body) } + it { should respond_to(:raw) } + it { should respond_to(:more) } + it { should respond_to(:more?) } + it { should respond_to(:success) } + it { should respond_to(:success?) } + it { should respond_to(:status) } + it { should respond_to(:continue) } +end + +# Everything will be readable so test for shared from Read behavior +shared_examples_for 'Soap Read Object' do + # begin backwards compat + it { should respond_to :props= } + it { should respond_to :authStub= } + # end + it { should respond_to :id } + it { should respond_to :properties } + it { should respond_to :client } + it { should respond_to :filter } + it { should respond_to :info } + it { should respond_to :get } +end + +shared_examples_for 'Soap CUD Object' do + it { should respond_to :post } + it { should respond_to :patch } + it { should respond_to :delete } +end + +shared_examples_for 'Soap Object' do + it_behaves_like 'Soap Read Object' + it_behaves_like 'Soap CUD Object' +end + +shared_examples_for 'Soap Read Only Object' do + it_behaves_like 'Soap Read Object' + it { should_not respond_to :post } + it { should_not respond_to :patch } + it { should_not respond_to :delete } +end +