Sha256: d6e46e53f830f004e415e86205e4a1b9575ae1fa4cc14793a428d2f4afd5796f

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

class Configurable
  extend VkontakteApi::Configuration
end

describe VkontakteApi::Configuration do
  describe "#configure" do
    it "yields self" do
      expect(Configurable).to receive(:some_method)
      Configurable.configure do |config|
        config.some_method
      end
    end
    
    it "returns self" do
      expect(Configurable.configure).to eq(Configurable)
    end
  end
  
  describe "#reset" do
    it "sets all options to their default values" do
      Configurable.reset
      
      expect(Configurable.app_id).to be_nil
      expect(Configurable.app_secret).to be_nil
      expect(Configurable.adapter).to eq(VkontakteApi::Configuration::DEFAULT_ADAPTER)
      expect(Configurable.http_verb).to eq(VkontakteApi::Configuration::DEFAULT_HTTP_VERB)
      expect(Configurable.faraday_options).to eq(Hash.new)
      
      expect(Configurable.logger).to be_a(Logger)
      expect(Configurable).to log_requests
      expect(Configurable).to log_errors
      expect(Configurable).not_to log_responses
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vkontakte_api-1.3.1 spec/vkontakte_api/configuration_spec.rb
vkontakte_api-1.3 spec/vkontakte_api/configuration_spec.rb