Sha256: 3f0cd0d74f3777628549a0aaf0bcab76df7cd0f7ac5f6ea666ca4913996b43d4

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

require 'spec_helper'

module HistoricoAtivos
  describe ParserTrailer do
    before(:each) do
      sample_row = "99COTAHIST.2003BOVESPA 2004053199999999999  "
      parser = ParserTrailer.new
      @trailer = parser.parse sample_row
    end

    it "deveria retornar nil se a linha nao comecar com 99" do
      sample_row = "50COTAHIST.2003BOVESPA 2004053100000000553  "
      parser = ParserTrailer.new
      trailer = parser.parse sample_row

      trailer.should be_nil
    end

    it "deveria extrair header contendo quantidade de ativos no arquivo lido" do
      @trailer.quantidade_ativos.should == 99999999999
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bovespa_ingestion-0.3.2 spec/historico_ativos/parser_trailer_spec.rb
bovespa_ingestion-0.3.1 spec/historico_ativos/parser_trailer_spec.rb
bovespa_ingestion-0.3.0 spec/historico_ativos/parser_trailer_spec.rb
bovespa_ingestion-0.2.0 spec/historico_ativos/parser_trailer_spec.rb
bovespa_ingestion-0.1.0 spec/historico_ativos/parser_trailer_spec.rb