Sha256: 35f20794a98b1d1e3f96897fc479e158ed270c70b8455e056df6dbaf5a501355
Contents?: true
Size: 1.53 KB
Versions: 23
Compression:
Stored size: 1.53 KB
Contents
# frozen_string_literal: true RSpec.describe FinApps::REST::Configuration do describe '#new' do context 'for invalid timeout configuration' do subject { FinApps::REST::Configuration.new(timeout: 'whatever') } it { expect { subject }.to raise_error(FinApps::InvalidArgumentsError, 'Invalid argument. {timeout: whatever}') } end context 'for missing timeout configuration' do subject { FinApps::REST::Configuration.new(timeout: nil) } it 'should have a default timeout value' do expect(subject.timeout).to eq(FinApps::REST::Defaults::DEFAULTS[:timeout]) end end context 'for invalid host configuration' do subject { FinApps::REST::Configuration.new(host: 'whatever') } it { expect { subject }.to raise_error(FinApps::InvalidArgumentsError, 'Invalid argument. {host: whatever}') } end context 'for missing host configuration' do subject { FinApps::REST::Configuration.new(host: nil) } it 'should have a default host value' do expect(subject.host).to eq(FinApps::REST::Defaults::DEFAULTS[:host]) end end end describe '#valid_user_credentials??' do context 'when user credentials were not set' do subject { FinApps::REST::Configuration.new(host: nil) } it { expect(subject.valid_user_credentials?).to eq(false) } end context 'when user credentials were set' do subject { FinApps::REST::Configuration.new(user_identifier: 1, user_token: 2) } it { expect(subject.valid_user_credentials?).to eq(true) } end end end
Version data entries
23 entries across 23 versions & 1 rubygems