summaryrefslogtreecommitdiff
path: root/spec/other/ssl_cert_spec.rb
blob: 4ed6ca53c1be691693a559e13892668f58e73780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true
require "spec_helper"
require "bundler/ssl_certs/certificate_manager"

describe "SSL Certificates", :rubygems_master do
  it "are up to date with Rubygems" do
    rubygems = File.expand_path("../../../tmp/rubygems", __FILE__)
    manager = Bundler::SSLCerts::CertificateManager.new(rubygems)
    expect(manager).to be_up_to_date
  end

  hosts = %w(
    rubygems.global.ssl.fastly.net
    rubygems.org
    staging.rubygems.org
    index.rubygems.org
  )

  hosts.each do |host|
    it "can securely connect to #{host}", :realworld do
      Bundler::SSLCerts::CertificateManager.new.connect_to(host)
    end
  end
end