Sha256: a45a1c3b0fe1bba1afb12543636f601875b1a92e43e994da69c50abdb0c19168

Contents?: true

Size: 844 Bytes

Versions: 8

Compression:

Stored size: 844 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 '4' }
    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]') { expect(described_class::DEFAULTS[:host]).to eq 'https://api.finclear.io' }
    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::INFO }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
finapps_core-5.0.7 spec/rest/defaults_spec.rb
finapps_core-5.0.6 spec/rest/defaults_spec.rb
finapps_core-5.0.5 spec/rest/defaults_spec.rb
finapps_core-5.0.4 spec/rest/defaults_spec.rb
finapps_core-5.0.3 spec/rest/defaults_spec.rb
finapps_core-5.0.2 spec/rest/defaults_spec.rb
finapps_core-5.0.1 spec/rest/defaults_spec.rb
finapps_core-5.0.0 spec/rest/defaults_spec.rb