require 'spec_helper' describe Transistor do context 'defaults' do before do Transistor.setup do |config| config.id = '103031111' config.secret = 'xxxx40' end end it 'should store configuration information' do expect(Transistor.config.id).to eq('103031111') expect(Transistor.config.secret).to eq('xxxx40') end it 'should default to https' do expect(Transistor.config.secure).to eq(true) end it 'should default to api.transistor.fm as the host' do expect(Transistor.config.host).to eq('api.transistor.fm') end end context 'Overriding defaults' do before do Transistor.setup do |config| config.id = '1030311101' config.secret = 'xxxx400' config.host = 'api.transistor.dev' config.secure = false end end it 'should override the host and secure config' do expect(Transistor.config.host).to eq('api.transistor.dev') expect(Transistor.config.secure).to eq(false) end end end