Sha256: d6ef2234fa128acda0337e211adc4dde09b8a5e410bc70195807b43ee473999d

Contents?: true

Size: 1000 Bytes

Versions: 5

Compression:

Stored size: 1000 Bytes

Contents

require 'spec_helper'

class Configurable
  extend VkontakteApi::Configuration
end

describe VkontakteApi::Configuration do
  describe "#configure" do
    it "yields self" do
      Configurable.should_receive(:some_method)
      Configurable.configure do |config|
        config.some_method
      end
    end
    
    it "returns self" do
      Configurable.configure.should == Configurable
    end
  end
  
  describe "#reset" do
    it "sets all options to their default values" do
      Configurable.reset
      Configurable.app_id.should be_nil
      Configurable.app_secret.should be_nil
      Configurable.adapter.should == VkontakteApi::Configuration::DEFAULT_ADAPTER
      Configurable.http_verb.should == VkontakteApi::Configuration::DEFAULT_HTTP_VERB
      Configurable.faraday_options.should == {}
      
      Configurable.logger.should be_a(Logger)
      Configurable.should log_requests
      Configurable.should log_errors
      Configurable.should_not log_responses
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vkontakte_api-1.2 spec/vkontakte_api/configuration_spec.rb
vkontakte_api-1.1 spec/vkontakte_api/configuration_spec.rb
vkontakte_api-1.0.4 spec/vkontakte_api/configuration_spec.rb
vkontakte_api-1.0.3 spec/vkontakte_api/configuration_spec.rb
vkontakte_api-1.0.2 spec/vkontakte_api/configuration_spec.rb