Sha256: 5d2a8b0124909359933beb5fa86387a41346cdf810c51f3f6f3da41d40c6f539

Contents?: true

Size: 1.59 KB

Versions: 39

Compression:

Stored size: 1.59 KB

Contents

require 'spec_helper'

describe FbGraph do
  subject { FbGraph }
  after { FbGraph.debugging = false }

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

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

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

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

  describe '.http_client' do
    context 'with http_config' do
      before do
        FbGraph.http_config do |config|
          config.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
          config.connect_timeout = 30
          config.send_timeout    = 40
          config.receive_timeout = 60
        end
      end
      it 'should configure Rack::OAuth2 and FbGraph http_client' do
        [Rack::OAuth2, FbGraph].each do |klass|
          klass.http_client.ssl_config.verify_mode.should == OpenSSL::SSL::VERIFY_NONE
          klass.http_client.connect_timeout.should == 30
          klass.http_client.send_timeout.should    == 40
          klass.http_client.receive_timeout.should == 60
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph_spec.rb
fb_graph-2.7.16 spec/fb_graph_spec.rb
fb_graph-2.7.15 spec/fb_graph_spec.rb
fb_graph-2.7.14 spec/fb_graph_spec.rb
fb_graph-2.7.13 spec/fb_graph_spec.rb
fb_graph-2.7.12 spec/fb_graph_spec.rb
fb_graph-2.7.11 spec/fb_graph_spec.rb
fb_graph-2.7.10 spec/fb_graph_spec.rb
fb_graph-2.7.9 spec/fb_graph_spec.rb
fb_graph-2.7.8 spec/fb_graph_spec.rb
fb_graph-2.7.7 spec/fb_graph_spec.rb
fb_graph-2.7.6 spec/fb_graph_spec.rb
fb_graph-2.7.5 spec/fb_graph_spec.rb
fb_graph-2.7.4 spec/fb_graph_spec.rb
fb_graph-2.7.3 spec/fb_graph_spec.rb
fb_graph-2.7.2 spec/fb_graph_spec.rb
fb_graph-2.7.1 spec/fb_graph_spec.rb
fb_graph-2.7.0 spec/fb_graph_spec.rb
fb_graph-2.6.7 spec/fb_graph_spec.rb
fb_graph-2.6.6 spec/fb_graph_spec.rb