mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Disable failing OS X tests.
Apple patches OpenSSL to always fall back on the system CA store, so the integration tests that expect SSL cert failures have never worked on OS X. Disable them since I can't think of a workaround :-(. TODO: add some integration tests on certificates that won't be in any system CA store.
This commit is contained in:
parent
a95da365bb
commit
902db106a6
3 changed files with 15 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ require File.dirname(__FILE__) + '/restclient/raw_response'
|
||||||
require File.dirname(__FILE__) + '/restclient/resource'
|
require File.dirname(__FILE__) + '/restclient/resource'
|
||||||
require File.dirname(__FILE__) + '/restclient/payload'
|
require File.dirname(__FILE__) + '/restclient/payload'
|
||||||
require File.dirname(__FILE__) + '/restclient/windows'
|
require File.dirname(__FILE__) + '/restclient/windows'
|
||||||
|
require File.dirname(__FILE__) + '/restclient/platform'
|
||||||
|
|
||||||
# This module's static methods are the entry point for using the REST client.
|
# This module's static methods are the entry point for using the REST client.
|
||||||
#
|
#
|
||||||
|
|
|
||||||
7
lib/restclient/platform.rb
Normal file
7
lib/restclient/platform.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
module RestClient
|
||||||
|
module Platform
|
||||||
|
def self.mac?
|
||||||
|
RUBY_PLATFORM.include?('darwin')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -31,7 +31,10 @@ describe RestClient::Request do
|
||||||
# TODO: deprecate and remove RestClient::SSLCertificateNotVerified and just
|
# TODO: deprecate and remove RestClient::SSLCertificateNotVerified and just
|
||||||
# pass through OpenSSL::SSL::SSLError directly. See note in
|
# pass through OpenSSL::SSL::SSLError directly. See note in
|
||||||
# lib/restclient/request.rb.
|
# lib/restclient/request.rb.
|
||||||
it "is unsuccessful with an incorrect ca_file" do
|
#
|
||||||
|
# On OS X, this test fails since Apple has patched OpenSSL to always fall
|
||||||
|
# back on the system CA store.
|
||||||
|
it "is unsuccessful with an incorrect ca_file", :unless => RestClient::Platform.mac? do
|
||||||
request = RestClient::Request.new(
|
request = RestClient::Request.new(
|
||||||
:method => :get,
|
:method => :get,
|
||||||
:url => 'https://www.mozilla.com',
|
:url => 'https://www.mozilla.com',
|
||||||
|
|
@ -40,7 +43,9 @@ describe RestClient::Request do
|
||||||
expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
|
expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "is unsuccessful with an incorrect ca_path" do
|
# On OS X, this test fails since Apple has patched OpenSSL to always fall
|
||||||
|
# back on the system CA store.
|
||||||
|
it "is unsuccessful with an incorrect ca_path", :unless => RestClient::Platform.mac? do
|
||||||
request = RestClient::Request.new(
|
request = RestClient::Request.new(
|
||||||
:method => :get,
|
:method => :get,
|
||||||
:url => 'https://www.mozilla.com',
|
:url => 'https://www.mozilla.com',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue