File tree Expand file tree Collapse file tree 6 files changed +17
-126
lines changed
Expand file tree Collapse file tree 6 files changed +17
-126
lines changed Original file line number Diff line number Diff line change 99require 'ofx/errors'
1010require 'ofx/parser'
1111require 'ofx/parser/ofx102'
12- require 'ofx/parser/ofx100'
1312require 'ofx/parser/ofx103'
1413require 'ofx/parser/ofx211'
1514require 'ofx/foundation'
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ def initialize(resource)
1717 end
1818
1919 case headers [ "VERSION" ]
20- when /100/ then
21- @parser = OFX100 . new ( :headers => headers , :body => body )
22- when /102/ then
20+ # when /100/ then
21+ # @parser = OFX100.new(:headers => headers, :body => body)
22+ when /102|100 / then
2323 @parser = OFX102 . new ( :headers => headers , :body => body )
2424 when /103/ then
2525 @parser = OFX103 . new ( :headers => headers , :body => body )
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4747 } . to raise_error ( OFX ::UnsupportedFileError )
4848 end
4949
50+ it "uses 102 parser to parse version 100 ofx files" do
51+ expect ( OFX ::Parser ::OFX102 ) . to receive ( :new ) . and_return ( 'ofx-102-parser' )
52+
53+ ofx = OFX ::Parser ::Base . new ( ofx_2_example ( '100' ) )
54+ expect ( ofx . parser ) . to eql 'ofx-102-parser'
55+ end
56+
5057 it "uses 211 parser to parse version 200 ofx files" do
5158 expect ( OFX ::Parser ::OFX211 ) . to receive ( :new ) . and_return ( 'ofx-211-parser' )
5259
6168 expect ( ofx . parser ) . to eql 'ofx-211-parser'
6269 end
6370
71+ it "uses 211 parser to parse version 220 ofx files" do
72+ expect ( OFX ::Parser ::OFX211 ) . to receive ( :new ) . and_return ( 'ofx-211-parser' )
73+
74+ ofx = OFX ::Parser ::Base . new ( ofx_2_example ( '220' ) )
75+ expect ( ofx . parser ) . to eql 'ofx-211-parser'
76+ end
77+
6478 describe "headers" do
6579 it "has OFXHEADER" do
6680 expect ( @ofx . headers [ "OFXHEADER" ] ) . to eql "100"
You can’t perform that action at this time.
0 commit comments