lib/async/rspec/ssl.rb in async-rspec-1.10.0 vs lib/async/rspec/ssl.rb in async-rspec-1.11.0
- old
+ new
@@ -37,11 +37,11 @@
module HostCertificates
end
end
- RSpec.shared_context SSL::CertificateAuthority do
+ ::RSpec.shared_context SSL::CertificateAuthority do
# This key size is generally considered insecure, but it's fine for testing.
let(:certificate_authority_key) {OpenSSL::PKey::RSA.new(1024)}
let(:certificate_authority_name) {OpenSSL::X509::Name.parse("O=Test/CN=localhost")}
# The certificate authority is used for signing and validating the certificate which is used for communciation:
@@ -77,11 +77,11 @@
certificates.add_cert(certificate_authority)
end
end
end
- RSpec.shared_context SSL::ValidCertificate do
+ ::RSpec.shared_context SSL::ValidCertificate do
include_context SSL::CertificateAuthority
# The private key to use on the server side:
let(:key) {OpenSSL::PKey::RSA.new(1024)}
let(:certificate_name) {OpenSSL::X509::Name.parse("O=Test/CN=localhost")}
@@ -108,11 +108,11 @@
certificate.sign certificate_authority_key, OpenSSL::Digest::SHA256.new
end
end
- RSpec.shared_context SSL::HostCertificates do
+ ::RSpec.shared_context SSL::HostCertificates do
include_context SSL::CertificateAuthority
let(:keys) do
Hash[
hosts.collect{|name| [name, OpenSSL::PKey::RSA.new(1024)]}
@@ -171,11 +171,11 @@
context.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
end
end
- RSpec.shared_context SSL::InvalidCertificate do
+ ::RSpec.shared_context SSL::InvalidCertificate do
include_context SSL::CertificateAuthority
# The private key to use on the server side:
let(:key) {OpenSSL::PKey::RSA.new(1024)}
let(:invalid_key) {OpenSSL::PKey::RSA.new(1024)}
@@ -203,10 +203,10 @@
certificate.sign invalid_key, OpenSSL::Digest::SHA256.new
end
end
- RSpec.shared_context SSL::VerifiedContexts do
+ ::RSpec.shared_context SSL::VerifiedContexts do
let(:server_context) do
OpenSSL::SSL::SSLContext.new.tap do |context|
context.cert = certificate
context.key = key
end