Sha256: 87c5acc25e82e67e321774b7768633d52bb9b52abe38f620c1f75e77398daba5
Contents?: true
Size: 1.72 KB
Versions: 12
Compression:
Stored size: 1.72 KB
Contents
describe Onfido do subject(:onfido) { described_class } after(:each) { onfido.reset } context 'configuration' do describe "default values" do describe ".api_key" do subject { onfido.api_key } it { is_expected.to be_nil } end describe ".endpoint" do subject { onfido.endpoint } it { is_expected.to eq('https://api.onfido.com/v2/') } end describe ".logger" do subject { onfido.logger } it { is_expected.to be_an_instance_of(Onfido::NullLogger) } end end describe "setting an API key" do it 'changes the configuration to the new value' do onfido.api_key = 'some_key' expect(onfido.api_key).to eq('some_key') end end describe "setting the API version" do it 'changes the configuration to the new value' do onfido.api_version = 'v1' expect(onfido.api_version).to eq('v1') expect(onfido.endpoint).to eq('https://api.onfido.com/v1/') end end describe '.logger' do context 'when an option is passed' do context 'when the option passed behaves like a logger' do let(:logger_like) { double('LoggerLike', :<< => nil) } it 'returns the option' do onfido.logger = logger_like expect(onfido.logger).to eq(logger_like) end end context 'when the option passed does not behave like a logger' do let(:non_logger) { double('NotLogger') } it 'raises an error' do expect { onfido.logger = non_logger }. to raise_error( "#{non_logger.class} doesn't seem to behave like a logger!" ) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems