1
0
Fork 0
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:
Andy Brody 2014-04-03 12:40:21 -07:00
parent a95da365bb
commit 902db106a6
3 changed files with 15 additions and 2 deletions

View file

@ -18,6 +18,7 @@ require File.dirname(__FILE__) + '/restclient/raw_response'
require File.dirname(__FILE__) + '/restclient/resource'
require File.dirname(__FILE__) + '/restclient/payload'
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.
#

View file

@ -0,0 +1,7 @@
module RestClient
module Platform
def self.mac?
RUBY_PLATFORM.include?('darwin')
end
end
end

View file

@ -31,7 +31,10 @@ describe RestClient::Request do
# TODO: deprecate and remove RestClient::SSLCertificateNotVerified and just
# pass through OpenSSL::SSL::SSLError directly. See note in
# 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(
:method => :get,
:url => 'https://www.mozilla.com',
@ -40,7 +43,9 @@ describe RestClient::Request do
expect { request.execute }.to raise_error(RestClient::SSLCertificateNotVerified)
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(
:method => :get,
:url => 'https://www.mozilla.com',