Sha256: 3dcef5ee0ef0ab78b3039fe2ddb7b55b4dfbd6a9bda758331ac3e4b9f1492cb5

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

RSpec.describe OiApi do

  it 'has a version' do
    expect(OiApi::VERSION).to be_instance_of(String)
  end

  it 'raises an error when instantiated with no username and password' do
    expect { OiApi.new }.to raise_error(OiApi::NoCredentialsError)
  end

  context 'configuration' do

    context '.username' do
      it 'defaults nil' do
        expect(OiApi.username).to be_nil
      end
    end

    context '.password' do
      it 'defaults nil' do
        expect(OiApi.password).to be_nil
      end
    end

    context '.api_endpoint' do
      it 'has a default' do
        expect(OiApi.api_endpoint).to eql(OiApi::Configuration::DEFAULT_API_ENDPOINT)
      end
    end

    context '.user_agent' do
      it 'has a default' do
        expect(OiApi.user_agent).to eql(OiApi::Configuration::DEFAULT_USER_AGENT)
      end
    end

    context '.format' do
      it 'has a default' do
        expect(OiApi.format).to eql(OiApi::Configuration::DEFAULT_FORMAT)
      end
    end

    context '.content_type' do
      it 'has a default' do
        expect(OiApi.content_type).to eql(OiApi::Configuration::DEFAULT_CONTENT_TYPE)
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oi-api-ruby-0.1.5 spec/oi_api_spec.rb
oi-api-ruby-0.1.4 spec/oi_api_spec.rb
oi-api-ruby-0.1.3 spec/oi_api_spec.rb
oi-api-ruby-0.1.2 spec/oi_api_spec.rb