Sha256: 09aa9b50165ef4e05967370a8143dd53bdec6c5eed8dd620809c77c1c2dd1726

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
transistor-client-0.0.2 spec/config_spec.rb
transistor-client-0.0.1 spec/config_spec.rb