mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Fix up tests.
Most of the should_not_receive calls should not have been passed a with(), since that's not what they were intended to test.
This commit is contained in:
parent
c7ca540bc3
commit
534cd8fc62
1 changed files with 13 additions and 4 deletions
|
@ -526,6 +526,15 @@ describe RestClient::Request do
|
|||
@request.transmit(@uri, 'req', 'payload')
|
||||
end
|
||||
|
||||
it "should set net.verify_mode to OpenSSL::SSL::VERIFY_PEER if verify_ssl is not given" do
|
||||
@request = RestClient::Request.new(:method => :put, :url => 'https://some/resource', :payload => 'payload')
|
||||
@net.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER)
|
||||
@http.stub(:request)
|
||||
@request.stub(:process_result)
|
||||
@request.stub(:response_log)
|
||||
@request.transmit(@uri, 'req', 'payload')
|
||||
end
|
||||
|
||||
it "should set net.verify_mode to the passed value if verify_ssl is an OpenSSL constant" do
|
||||
mode = OpenSSL::SSL::VERIFY_PEER | OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT
|
||||
@request = RestClient::Request.new( :method => :put,
|
||||
|
@ -619,7 +628,7 @@ describe RestClient::Request do
|
|||
:url => 'https://some/resource',
|
||||
:payload => 'payload'
|
||||
)
|
||||
@net.should_not_receive(:cert=).with("whatsupdoc!")
|
||||
@net.should_not_receive(:cert=)
|
||||
@http.stub(:request)
|
||||
@request.stub(:process_result)
|
||||
@request.stub(:response_log)
|
||||
|
@ -650,7 +659,7 @@ describe RestClient::Request do
|
|||
:url => 'https://some/resource',
|
||||
:payload => 'payload'
|
||||
)
|
||||
@net.should_not_receive(:key=).with("whatsupdoc!")
|
||||
@net.should_not_receive(:key=)
|
||||
@http.stub(:request)
|
||||
@request.stub(:process_result)
|
||||
@request.stub(:response_log)
|
||||
|
@ -681,7 +690,7 @@ describe RestClient::Request do
|
|||
:url => 'https://some/resource',
|
||||
:payload => 'payload'
|
||||
)
|
||||
@net.should_not_receive(:ca_file=).with("Certificate Authority File")
|
||||
@net.should_not_receive(:ca_file=)
|
||||
@http.stub(:request)
|
||||
@request.stub(:process_result)
|
||||
@request.stub(:response_log)
|
||||
|
@ -712,7 +721,7 @@ describe RestClient::Request do
|
|||
:url => 'https://some/resource',
|
||||
:payload => 'payload'
|
||||
)
|
||||
@net.should_not_receive(:ca_path=).with("Certificate Authority File")
|
||||
@net.should_not_receive(:ca_path=)
|
||||
@http.stub(:request)
|
||||
@request.stub(:process_result)
|
||||
@request.stub(:response_log)
|
||||
|
|
Loading…
Reference in a new issue