Sha256: 0014b1090bef49d689bd28bad008fb83f5f56675587620dd166dda01899847f8

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe GiveyRuby::Configuration do

  context "api_site" do
    before(:each) do
      GiveyRuby.configure do |config|
        config.client({api_site: "http://example.com"})
      end
    end

    describe "Client options" do
      it "GiveyRuby configure should set OAuth2 client correctly" do
        GiveyRuby.configuration.client.should be_kind_of(OAuth2::Client)
        GiveyRuby.configuration.client.site.should == "http://example.com"
      end
    end

    describe "Session options" do
      it "GiveyRuby configure should set OAuth2 client correctly" do
        GiveyRuby.configuration.client.should be_kind_of(OAuth2::Client)
        GiveyRuby.configuration.client.site.should == "http://example.com"
      end
    end
  end

  describe "#api_version" do
    let(:config) { GiveyRuby::Configuration.new }
    let(:subject) { config.api_version }

    context "default" do
      before { config.client }
      it { should == "v2" }
    end

    context "specified" do
      before { config.client({ api_version: "v1" }) }
      it { should == "v1" }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
givey_ruby-0.0.6 spec/givey_ruby/configuration_spec.rb