Sha256: 0336189a31748d5b10913964a0a3d39795142326b865254210368efff6e9065c

Contents?: true

Size: 1.05 KB

Versions: 4

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 be_eql(Logger::INFO)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
boltless-1.3.0 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.2.0 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.1.0 spec/boltless/extensions/configuration_handling_spec.rb
boltless-1.0.0 spec/boltless/extensions/configuration_handling_spec.rb