Sha256: a2feb50fde439357d483d3a3e06dea2e2e958340981993663bee0bcef6cf4b26

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

require 'spec_helper'

describe IEX::Resources::Price do
  context 'known symbol', vcr: { cassette_name: 'price/msft' } do
    subject do
      IEX::Resources::Price.get('MSFT')
    end
    it 'retrieves a price' do
      expect(subject).to eq 93.78
    end
  end
  context 'invalid symbol', vcr: { cassette_name: 'price/invalid' } do
    subject do
      IEX::Resources::Price.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

4 entries across 4 versions & 1 rubygems

Version Path
iex-ruby-client-0.3.3 spec/iex/resources/price_spec.rb
iex-ruby-client-0.3.2 spec/iex/resources/price_spec.rb
iex-ruby-client-0.3.1 spec/iex/resources/price_spec.rb
iex-ruby-client-0.3.0 spec/iex/resources/price_spec.rb