Sha256: 41ea5ec49463053fc27d3c8df0afe756fccb6b960ab3cf095f8cce24fdca381b

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Boltless::Extensions::ConfigurationHandling do
  let(:described_class) { Boltless }

  before { described_class.reset_configuration! }

  it 'allows the access of the configuration' do
    expect(described_class.configuration).not_to be_nil
  end

  describe '.configure' do
    it 'yields the configuration' do
      expect do |block|
        described_class.configure(&block)
      end.to yield_with_args(described_class.configuration)
    end
  end

  describe '.reset_configuration!' do
    it 'resets the configuration to its defaults' do
      described_class.configuration.request_timeout = 100
      expect { described_class.reset_configuration! }.to \
        change { described_class.configuration.request_timeout }
    end
  end

  describe '.logger' do
    it 'returns a Logger instance' do
      expect(described_class.logger).to be_a(Logger)
    end

    it 'returns a logger with the default info level' do
      expect(described_class.logger.level).to eql(Logger::INFO)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
boltless-1.4.4 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.4.3 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.4.2 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.4.1 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.4.0 spec/boltless/extensions/configuration_handling_spec.rb