Sha256: a65c0ff5f743f6da4a5ef64b5d8e11a3204e7365965a6e89377bc80751f36c43

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

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.0.3"
      }
    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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capgun-0.1.0 spec/capgun/config_spec.rb
capgun-0.0.3 spec/capgun/config_spec.rb