Sha256: c1887ec251a3dec067eddd83abfb67f683d6caea157abaabef53ac6a33c68ef5

Contents?: true

Size: 562 Bytes

Versions: 13

Compression:

Stored size: 562 Bytes

Contents

require 'spec_helper'

describe IEX::Api::Client do
  include_context 'client'

  context 'known symbol', vcr: { cassette_name: 'price/msft' } do
    subject do
      client.price('MSFT')
    end
    it 'retrieves a price' do
      expect(subject).to eq 119.36
    end
  end

  context 'invalid symbol', vcr: { cassette_name: 'price/invalid' } do
    subject do
      client.price('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

13 entries across 13 versions & 1 rubygems

Version Path
iex-ruby-client-2.1.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-2.0.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.6.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.5.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.4.1 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.4.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.3.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.2.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.1.2 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.1.1 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.1.0 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.0.1 spec/iex/endpoints/price_spec.rb
iex-ruby-client-1.0.0 spec/iex/endpoints/price_spec.rb