Sha256: 4c50e548b0009ab4adfa72c5eb491ae4beffe61019998967b4740bc51f506c0f

Contents?: true

Size: 767 Bytes

Versions: 2

Compression:

Stored size: 767 Bytes

Contents

RSpec.describe SoapyBing::Helpers::SSLVersion do
  describe '#ssl_version' do
    subject { stub_const('MyClass', Class.new.include(described_class)).new.ssl_version }

    context 'when DEFAULT_SSL_VERSION is available' do
      before do
        stub_const('OpenSSL::SSL::SSLContext::METHODS', [described_class::DEFAULT_SSL_VERSION])
      end

      it 'responds with DEFAULT_SSL_VERSION' do
        expect(subject).to be MyClass::DEFAULT_SSL_VERSION
      end
    end

    context 'when DEFAULT_SSL_VERSION is not available' do
      before { stub_const('OpenSSL::SSL::SSLContext::METHODS', []) }

      it 'responds with OpenSSL default version' do
        expect(subject).to be OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
soapy_bing-0.0.4 spec/soapy_bing/helpers/ssl_version_spec.rb
soapy_bing-0.0.3 spec/soapy_bing/helpers/ssl_version_spec.rb