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    
razorsync / spec / razorsync_spec.rb
Size: Mime:
require 'spec_helper'

RSpec.describe Razorsync do
  after do
    Razorsync.reset
  end

  describe ".client" do
    it "should be a Razorsync::Client" do
      expect(Razorsync.client).to be_a(Razorsync::Client)
    end
  end

  describe '#token' do
    it 'should return the default token' do
      expect(Razorsync.token).to eq(Razorsync::Configuration::DEFAULT_TOKEN)
    end
  end

  describe '#token=' do
    it 'should set the token' do
      Razorsync.token = 'test token'
      expect(Razorsync.token).to eq('test token')
    end
  end

  describe '#portal_name' do
    it 'should return the default portal name' do
      expect(Razorsync.portal_name).to eq(Razorsync::Configuration::DEFAULT_PORTAL_NAME)
    end
  end

  describe '#portal_name=' do
    it 'should set the portal name' do
      Razorsync.portal_name = 'test portal'
      expect(Razorsync.portal_name).to eq('test portal')
    end
  end

  describe '#adapter' do
    it 'should return the default adapter' do
      expect(Razorsync.adapter).to eq(Razorsync::Configuration::DEFAULT_ADAPTER)
    end
  end

  describe '#adapter=' do
    it 'should set the adapter' do
      Razorsync.adapter = :typhoeus
      expect(Razorsync.adapter).to eq(:typhoeus)
    end
  end

  describe '#configure' do
    Razorsync::Configuration::VALID_OPTIONS_KEYS.each do |key|

      it "should set the #{key}" do
        Razorsync.configure do |config|
          config.send("#{key}=", key)
          expect(Razorsync.send(key)).to eq(key)
        end
      end
    end
  end
end