require 'spec_helper' describe Capgun::Config do subject do Capgun end describe '#configure' do specify "yields self to be configured" do subject.configure do |config| config.endpoint = 'http://example.com/api' end subject.endpoint.should == 'http://example.com/api' end end describe '.options' do specify "returns a hash of default capgun options" do subject.options.should == { :adapter => :net_http, :auth_token => "", :connection_options => {}, :endpoint => "http://example.com/api", :gateway => nil, :proxy => nil, :user_agent => "Capgun.io Ruby Gem 0.1.1" } end end describe '.reset' do specify "resets to the default capgun options" do subject.configure do |config| config.endpoint = 'http://example.com/api' end subject.endpoint.should == 'http://example.com/api' subject.reset subject.endpoint.should == 'https://api.capgun.io' end end end