Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
more authentic SSL cert failure for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Mar 2, 2013
1 parent 0e79a64 commit 7abeaeb
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions spec/install/gems/dependency_api_spec.rb
Expand Up @@ -435,17 +435,11 @@
context "when SSL certificate verification fails" do
it "explains what happened" do
# Install a monkeypatch that reproduces the effects of openssl raising
# a certificate validation error at the appropriate moment.
# a certificate validation error when Rubygems tries to connect.
gemfile <<-G
class Net::HTTP::Persistent
def request(uri, req = nil)
raise OpenSSL::SSL::SSLError, "Certificate invalid"
end
end
class Bundler::RubygemsIntegration
def fetch_all_remote_specs
raise OpenSSL::SSL::SSLError, "Certificate invalid"
class Net::HTTP
def start
raise OpenSSL::SSL::SSLError, "certificate verify failed"
end
end
Expand Down

0 comments on commit 7abeaeb

Please sign in to comment.