Sha256: ed145ff05a0e48396accca11d8ce3a9bfa92716f28a04574a00f7753025e4182

Contents?: true

Size: 1.01 KB

Versions: 16

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'rakuten_web_service/configuration'

describe RakutenWebService::Configuration do
  describe '.configuration' do
    context 'given block has one arity' do
      before do
        RakutenWebService.configuration do |c|
          c.affiliate_id = 'dummy_affiliate_id'
          c.application_id = 'dummy_application_id'
        end
      end

      subject { RakutenWebService.configuration }

      its(:affiliate_id) { should eq('dummy_affiliate_id') }
      its(:application_id) { should eq('dummy_application_id') }
    end

    context 'given block has more or less one arity' do
      specify 'raise ArgumentError' do
        expect do
          RakutenWebService.configuration do
          end
        end.to raise_error(ArgumentError)

        expect do
          RakutenWebService.configuration do |c, _|
            c.affiliate_id = 'dummy_affiliate_id'
            c.application_id = 'dummy_application_id'
          end
        end.to raise_error(ArgumentError)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rakuten_web_service-0.6.3 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.6.2 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.6.1 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.6.0 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.5.0 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.4.2 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.4.1 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.3.1 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.3.0 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.2.3 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.2.2 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.2.1 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.2.0 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.1.1 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.1.0 spec/rakuten_web_service/configuration_spec.rb
rakuten_web_service-0.0.1 spec/rakuten_web_service/configuration_spec.rb