Sha256: 36972a334b45bbbc3815d2f21ee098c8cbfb09c14f44db3419eceddb9c56baba

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true
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.1.0 spec/soapy_bing/helpers/ssl_version_spec.rb
soapy_bing-0.0.5 spec/soapy_bing/helpers/ssl_version_spec.rb