Repository URL to install this package:
|
Version:
0.0.1 ▾
|
require 'byebug'
require 'spec_helper'
RSpec.describe Gingr do
after do
Gingr.reset
end
describe ".client" do
it "should be a Gingr::Client" do
expect(Gingr.client).to be_a(Gingr::Client)
end
end
describe '#api_key' do
it 'should return the default api key' do
expect(Gingr.api_key).to eq(Gingr::Configuration::DEFAULT_API_KEY)
end
end
describe '#api_key=' do
it 'should set the api key' do
Gingr.api_key = 'test'
expect(Gingr.api_key).to eq('test')
end
end
describe '#adapter' do
it 'should return the default adapter' do
expect(Gingr.adapter).to eq(Gingr::Configuration::DEFAULT_ADAPTER)
end
end
describe '#adapter=' do
it 'should set the adapter' do
Gingr.adapter = :typhoeus
expect(Gingr.adapter).to eq(:typhoeus)
end
end
describe '#company_app_name' do
it 'should return the default company_app_name' do
expect(Gingr.company_app_name).to eq(Gingr::Configuration::DEFAULT_COMPANY_APP_NAME)
end
end
describe '#company_app_name=' do
it 'should set the adapter' do
Gingr.company_app_name = 'test_company'
expect(Gingr.company_app_name).to eq('test_company')
end
end
describe '#configure' do
Gingr::Configuration::VALID_OPTIONS_KEYS.each do |key|
it "should set the #{key}" do
Gingr.configure do |config|
config.send("#{key}=", key)
expect(Gingr.send(key)).to eq(key)
end
end
end
end
end