Sha256: 8b25d99489d60d7d3ca63452be359ef9d8da40fbbcf20f66adfd23062c2b7a88

Contents?: true

Size: 1.86 KB

Versions: 11

Compression:

Stored size: 1.86 KB

Contents

require 'spec_helper'

describe BooticClient::Configuration do
  context 'errors' do
    it "raises if nil client_id" do
      expect {
        BooticClient.configure do |c|
          c.client_id = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end

    it "raises if nil client_secret" do
      expect {
        BooticClient.configure do |c|
          c.client_secret = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end

    it "raises if nil cache_store" do
      expect {
        BooticClient.configure do |c|
          c.cache_store = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end

    it "raises if nil or invalid auth_host" do
      expect {
        BooticClient.configure do |c|
          c.auth_host = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError

      expect {
        BooticClient.configure do |c|
          c.auth_host = 'not-a-url'
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end

    it "raises if nil or invalid api_root" do
      expect {
        BooticClient.configure do |c|
          c.api_root = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError

      expect {
        BooticClient.configure do |c|
          c.api_root = 'not-a-url'
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end

    it "raises if nil logger" do
      expect {
        BooticClient.configure do |c|
          c.logger = nil
        end
      }.to raise_error BooticClient::InvalidConfigurationError
    end
  end

  context 'instance' do
    subject(:config) { described_class.new }

    describe '#response_handlers' do
      it 'includes Entity handler by default' do
        expect(config.response_handlers.to_a.first).not_to be_nil
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bootic_client-0.0.32 spec/configuration_spec.rb
bootic_client-0.0.31 spec/configuration_spec.rb
bootic_client-0.0.30 spec/configuration_spec.rb
bootic_client-0.0.29 spec/configuration_spec.rb
bootic_client-0.0.28 spec/configuration_spec.rb
bootic_client-0.0.27 spec/configuration_spec.rb
bootic_client-0.0.26 spec/configuration_spec.rb
bootic_client-0.0.25 spec/configuration_spec.rb
bootic_client-0.0.24 spec/configuration_spec.rb
bootic_client-0.0.23 spec/configuration_spec.rb
bootic_client-0.0.22 spec/configuration_spec.rb