spec/reckon/app_spec.rb in reckon-0.3.7 vs spec/reckon/app_spec.rb in reckon-0.3.8

- old
+ new

@@ -14,10 +14,12 @@ @two_money_columns = Reckon::App.new(:string => TWO_MONEY_COLUMNS_BANK) @simple_csv = Reckon::App.new(:string => SIMPLE_CSV) @german_date = Reckon::App.new(:string => GERMAN_DATE_EXAMPLE) @danish_kroner_nordea = Reckon::App.new(:string => DANISH_KRONER_NORDEA_EXAMPLE, :csv_separator => ';', :comma_separates_cents => true) @yyyymmdd_date = Reckon::App.new(:string => YYYYMMDD_DATE_EXAMPLE) + @spanish_date = Reckon::App.new(:string => SPANISH_DATE_EXAMPLE, :date_format => '%d/%m/%Y') + @english_date = Reckon::App.new(:string => ENGLISH_DATE_EXAMPLE) end it "should be in testing mode" do @chase.settings[:testing].should be_true Reckon::App.settings[:testing].should be_true @@ -139,10 +141,16 @@ @danish_kroner_nordea.date_for(0).month.should == Time.parse("2012/11/16").month @danish_kroner_nordea.date_for(0).day.should == Time.parse("2012/11/16").day @yyyymmdd_date.date_for(0).year.should == Time.parse("2012/12/31").year @yyyymmdd_date.date_for(0).month.should == Time.parse("2012/12/31").month @yyyymmdd_date.date_for(0).day.should == Time.parse("2012/12/31").day + @spanish_date.date_for(1).year.should == Time.parse("2009/12/02").year + @spanish_date.date_for(1).month.should == Time.parse("2009/12/02").month + @spanish_date.date_for(1).day.should == Time.parse("2009/12/02").day + @english_date.date_for(1).year.should == Time.parse("2009/12/24").year + @english_date.date_for(1).month.should == Time.parse("2009/12/24").month + @english_date.date_for(1).day.should == Time.parse("2009/12/24").day end end describe "description_for" do it "should return the combined fields that are not money for date fields" do @@ -267,8 +275,20 @@ 27-08-2012;Dankort-nota MATAS - 20319 18230;27-08-2012;-655,00;21127,45 CSV YYYYMMDD_DATE_EXAMPLE = (<<-CSV).strip DEBIT,20121231,"ODESK***BAL-27DEC12 650-12345 CA 12/28",-123.45 + CSV + + SPANISH_DATE_EXAMPLE = (<<-CSV).strip + 02/12/2009,Check - 0000000122,122,-$76.00,"","$1,750.06" + 02/12/2009,BLARG R SH 456930,"","",+$327.49,"$1,826.06" + 02/12/2009,Check - 0000000112,112,-$800.00,"","$1,498.57" + CSV + + ENGLISH_DATE_EXAMPLE = (<<-CSV).strip + 24/12/2009,Check - 0000000122,122,-$76.00,"","$1,750.06" + 24/12/2009,BLARG R SH 456930,"","",+$327.49,"$1,826.06" + 24/12/2009,Check - 0000000112,112,-$800.00,"","$1,498.57" CSV end