Sha256: 45ede59d4db4f5d0ae8218dd3a27ee8d1949380b97a90d87493a3331953c9bf4

Contents?: true

Size: 1.7 KB

Versions: 30

Compression:

Stored size: 1.7 KB

Contents

require 'spec_helper'

describe OpenIDConnect do
  after { OpenIDConnect.debugging = false }

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

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

  describe '.debug' do
    it 'should enable debugging within given block' do
      OpenIDConnect.debug do
        SWD.debugging?.should == true
        WebFinger.debugging?.should == true
        Rack::OAuth2.debugging?.should == true
        OpenIDConnect.debugging?.should == true
      end
      SWD.debugging?.should == false
      Rack::OAuth2.debugging?.should == false
      OpenIDConnect.debugging?.should == false
    end

    it 'should not force disable debugging' do
      SWD.debug!
      WebFinger.debug!
      Rack::OAuth2.debug!
      OpenIDConnect.debug!
      OpenIDConnect.debug do
        SWD.debugging?.should == true
        WebFinger.debugging?.should == true
        Rack::OAuth2.debugging?.should == true
        OpenIDConnect.debugging?.should == true
      end
      SWD.debugging?.should == true
      WebFinger.debugging?.should == true
      Rack::OAuth2.debugging?.should == true
      OpenIDConnect.debugging?.should == 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, WebFinger, 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

30 entries across 30 versions & 1 rubygems

Version Path
openid_connect-0.11.2 spec/openid_connect_spec.rb
openid_connect-0.11.1 spec/openid_connect_spec.rb
openid_connect-0.11.0 spec/openid_connect_spec.rb
openid_connect-0.10.0 spec/openid_connect_spec.rb
openid_connect-0.9.2 spec/openid_connect_spec.rb
openid_connect-0.9.1 spec/openid_connect_spec.rb
openid_connect-0.9.0 spec/openid_connect_spec.rb
openid_connect-0.8.3 spec/openid_connect_spec.rb
openid_connect-0.8.2 spec/openid_connect_spec.rb
openid_connect-0.8.1 spec/openid_connect_spec.rb