Sha256: 27055b3855b53a662303c882260d6911ba7a7773b8fdb3a12b273092b20ca0fa

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe IEX::Resources::Company do
  context 'known symbol', vcr: { cassette_name: 'company/msft' } do
    subject do
      IEX::Resources::Company.get('MSFT')
    end
    it 'retrieves company information' do
      expect(subject.symbol).to eq 'MSFT'
      expect(subject.ceo).to eq 'Satya Nadella'
      expect(subject.company_name).to eq 'Microsoft Corporation'
      expect(subject.description).to include 'Microsoft Corp is a technology company.'
      expect(subject.exchange).to eq 'Nasdaq Global Select'
      expect(subject.industry).to eq 'Application Software'
      expect(subject.issue_type).to eq 'cs'
      expect(subject.website).to eq 'http://www.microsoft.com'
      expect(subject.sector).to eq 'Technology'
    end
  end
  context 'invalid symbol', vcr: { cassette_name: 'company/invalid' } do
    subject do
      IEX::Resources::Company.get('INVALID')
    end
    it 'fails with SymbolNotFoundError' do
      expect { subject }.to raise_error IEX::Errors::SymbolNotFoundError, 'Symbol INVALID Not Found'
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iex-ruby-client-0.4.4 spec/iex/resources/company_spec.rb
iex-ruby-client-0.4.3 spec/iex/resources/company_spec.rb
iex-ruby-client-0.4.2 spec/iex/resources/company_spec.rb
iex-ruby-client-0.4.1 spec/iex/resources/company_spec.rb
iex-ruby-client-0.4.0 spec/iex/resources/company_spec.rb
iex-ruby-client-0.3.3 spec/iex/resources/company_spec.rb
iex-ruby-client-0.3.2 spec/iex/resources/company_spec.rb
iex-ruby-client-0.3.1 spec/iex/resources/company_spec.rb
iex-ruby-client-0.3.0 spec/iex/resources/company_spec.rb
iex-ruby-client-0.2.0 spec/iex/resources/company_spec.rb