Sha256: 05f773f3997447b1c15965ee570669c46e06c827ea50cf15ec0097b600b1add8

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

# frozen_string_literal: true

RSpec.describe FinAppsCore::REST::Defaults do
  let(:fake_class) { Class.new }

  describe 'set constants' do
    before { stub_const(described_class.to_s, fake_class) }

    it('sets API_VERSION') { expect(described_class::API_VERSION).to eq '5' }
    it('sets DEFAULTS') { expect(described_class::DEFAULTS).to be_a(Hash) }
    it('freezes DEFAULTS') { expect(described_class::DEFAULTS).to be_frozen }

    it('sets DEFAULTS[:host]') {
      expected = 'https://api.allcleardecisioning.com'
      expect(described_class::DEFAULTS[:host]).to eq expected
    }

    it('sets DEFAULTS[:timeout]') {
      expect(described_class::DEFAULTS[:timeout]).to eq 30
    }

    it('does not set DEFAULTS[:proxy]') {
      expect(described_class::DEFAULTS[:proxy]).to be_nil
    }

    it('sets DEFAULTS[:log_level]') {
      expect(described_class::DEFAULTS[:log_level]).to eq Logger::UNKNOWN
    }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
finapps_core-6.0.2 spec/rest/defaults_spec.rb
finapps_core-6.0.1 spec/rest/defaults_spec.rb
finapps_core-6.0.0 spec/rest/defaults_spec.rb