Sha256: 8c7c43c94c8f039c5e71db131a416984d76d600089a1cb8c1b81a1eb304a1653

Contents?: true

Size: 1.54 KB

Versions: 25

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

describe OpenIDConnect do
  after { OpenIDConnect.debugging = false }

  its(:logger) { should be_a Logger }
  its(:debugging?) { should be_false }

  describe '.debug!' do
    before { OpenIDConnect.debug! }
    its(:debugging?) { should be_true }
  end

  describe '.debug' do
    it 'should enable debugging within given block' do
      OpenIDConnect.debug do
        SWD.debugging?.should be_true
        Rack::OAuth2.debugging?.should be_true
        OpenIDConnect.debugging?.should be_true
      end
      SWD.debugging?.should be_false
      Rack::OAuth2.debugging?.should be_false
      OpenIDConnect.debugging?.should be_false
    end

    it 'should not force disable debugging' do
      SWD.debug!
      Rack::OAuth2.debug!
      OpenIDConnect.debug!
      OpenIDConnect.debug do
        SWD.debugging?.should be_true
        Rack::OAuth2.debugging?.should be_true
        OpenIDConnect.debugging?.should be_true
      end
      SWD.debugging?.should be_true
      Rack::OAuth2.debugging?.should be_true
      OpenIDConnect.debugging?.should be_true
    end
  end

  describe '.http_client' do
    context 'with http_config' do
      before do
        OpenIDConnect.http_config do |config|
          config.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
        end
      end
      it 'should configure OpenIDConnect, SWD and Rack::OAuth2\'s http_client' do
        [OpenIDConnect, SWD, Rack::OAuth2].each do |klass|
          klass.http_client.ssl_config.verify_mode.should == OpenSSL::SSL::VERIFY_NONE
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
openid_connect-0.5.0 spec/openid_connect_spec.rb
openid_connect-0.4.1 spec/openid_connect_spec.rb
openid_connect-0.4.0 spec/openid_connect_spec.rb
openid_connect-0.3.7 spec/openid_connect_spec.rb
openid_connect-0.3.6 spec/openid_connect_spec.rb
openid_connect-0.3.5 spec/openid_connect_spec.rb
openid_connect-0.3.4 spec/openid_connect_spec.rb
openid_connect-0.3.3 spec/openid_connect_spec.rb
openid_connect-0.3.2 spec/openid_connect_spec.rb
openid_connect-0.3.1 spec/openid_connect_spec.rb
openid_connect-0.3.0 spec/openid_connect_spec.rb
openid_connect-0.2.4 spec/openid_connect_spec.rb
openid_connect-0.2.3 spec/openid_connect_spec.rb
openid_connect-0.2.2 spec/openid_connect_spec.rb
openid_connect-0.2.1 spec/openid_connect_spec.rb
openid_connect-0.2.0 spec/openid_connect_spec.rb
openid_connect-0.2.0.alpha3 spec/openid_connect_spec.rb
openid_connect-0.2.0.alpha2 spec/openid_connect_spec.rb
openid_connect-0.2.0.alpha spec/openid_connect_spec.rb
openid_connect-0.1.5 spec/openid_connect_spec.rb