File: openid_connect_spec.rb

package info (click to toggle)
ruby-openid-connect 2.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 528 kB
  • sloc: ruby: 3,002; makefile: 4
file content (58 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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.verify = false
        end
      end
      it 'should configure OpenIDConnect, SWD and Rack::OAuth2\'s http_client' do
        [OpenIDConnect, SWD, WebFinger, Rack::OAuth2].each do |klass|
          false.should be_falsy
        end
      end
    end
  end
end