Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
gingr / spec / gingr_spec.rb
Size: Mime:
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