Sha256: 5ea596cab924733af56d8165fdc6eefa3a8a12cf556f9a2a09fc1dd42cf88254

Contents?: true

Size: 631 Bytes

Versions: 5

Compression:

Stored size: 631 Bytes

Contents

require 'helper'

describe StockIndex::BsymSearch do

  context 'searching a symbol in EXCEPTIONS' do

    it 'returns the component' do
      expect(StockIndex::BsymSearch.find('BIDU', :us)).to eq({name: 'BAIDU INC', bbgid: 'BBG000QXWHD1'})
    end

  end

  context 'searching a symbol in the CSV file' do

    it 'returns the component' do
      expect(StockIndex::BsymSearch.find('CSCO', :us)).to eq({:name=>"CISCO SYSTEMS INC", :bbgid=>"BBG000C3J3C9"})
    end

  end

  context 'searching a non existent symbol' do

    it 'returns nil' do
      expect(StockIndex::BsymSearch.find('ZZZZ', :us)).to eq(nil)
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stock_index-0.8.3 spec/stock_index/bsym_search_spec.rb
stock_index-0.8.2 spec/stock_index/bsym_search_spec.rb
stock_index-0.8.1 spec/stock_index/bsym_search_spec.rb
stock_index-0.8.0 spec/stock_index/bsym_search_spec.rb
stock_index-0.7.0 spec/stock_index/bsym_search_spec.rb