From a8669b95f9b58ee1cb39b8314fef961d099d253e Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Thu, 8 May 2025 15:55:02 -0300 Subject: [PATCH 1/9] Add support to OFX 1.0.0 --- Gemfile.lock | 2 +- lib/ofx.rb | 1 + lib/ofx/parser.rb | 2 ++ lib/ofx/parser/ofx100.rb | 7 +++++ lib/ofx/version.rb | 2 +- spec/fixtures/v100.ofx | 64 ++++++++++++++++++++++++++++++++++++++++ spec/ofx/ofx100_spec.rb | 51 ++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 lib/ofx/parser/ofx100.rb create mode 100644 spec/fixtures/v100.ofx create mode 100644 spec/ofx/ofx100_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index 44376d9..330754f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ofx (0.4.1) + ofx (0.4.2) bigdecimal (= 3.1.8) nkf (= 0.2.0) nokogiri (>= 1.14.5) diff --git a/lib/ofx.rb b/lib/ofx.rb index f58dcbe..6dde6e0 100644 --- a/lib/ofx.rb +++ b/lib/ofx.rb @@ -9,6 +9,7 @@ require 'ofx/errors' require 'ofx/parser' require 'ofx/parser/ofx102' +require 'ofx/parser/ofx100' require 'ofx/parser/ofx103' require 'ofx/parser/ofx211' require 'ofx/foundation' diff --git a/lib/ofx/parser.rb b/lib/ofx/parser.rb index e993fb5..15bf40c 100644 --- a/lib/ofx/parser.rb +++ b/lib/ofx/parser.rb @@ -17,6 +17,8 @@ def initialize(resource) end case headers["VERSION"] + when /100/ then + @parser = OFX100.new(:headers => headers, :body => body) when /102/ then @parser = OFX102.new(:headers => headers, :body => body) when /103/ then diff --git a/lib/ofx/parser/ofx100.rb b/lib/ofx/parser/ofx100.rb new file mode 100644 index 0000000..9a2770e --- /dev/null +++ b/lib/ofx/parser/ofx100.rb @@ -0,0 +1,7 @@ +module OFX + module Parser + class OFX100 < OFX102 + VERSION = '1.0.0' + end + end +end diff --git a/lib/ofx/version.rb b/lib/ofx/version.rb index b3577e6..e4031e9 100644 --- a/lib/ofx/version.rb +++ b/lib/ofx/version.rb @@ -1,3 +1,3 @@ module OFX - VERSION = '0.4.1'.freeze + VERSION = '0.4.2'.freeze end diff --git a/spec/fixtures/v100.ofx b/spec/fixtures/v100.ofx new file mode 100644 index 0000000..f0b0dc2 --- /dev/null +++ b/spec/fixtures/v100.ofx @@ -0,0 +1,64 @@ +OFXHEADER:100 +DATA:OFXSGML +VERSION:100 +SECURITY:NONE +ENCODING:UTF-8 +CHARSET:NONE +COMPRESSION:NONE +OLDFILEUID:NONE +NEWFILEUID:NONE + + + + + 0 + INFO + + 20250423150648[-3:BRT] + POR + + PagSeguro Internet S/A + 290 + + + + + + + 0 + INFO + + + BRL + + 290 + 26215973324 + CHECKING + + + 20250414000000[-3:BRT] + 20250423000000[-3:BRT] + + + OUT + 20250414185036[-3:BRT] + -1020.88 + 201505041 + PAGAMENTO TITULO-CNB + + + OUT + 20250414185009[-3:BRT] + -82.10 + 201505051 + TAR PACOTE MENSAL + + + + 3806.63 + 23/04/2025 + + + + + diff --git a/spec/ofx/ofx100_spec.rb b/spec/ofx/ofx100_spec.rb new file mode 100644 index 0000000..c22e4f6 --- /dev/null +++ b/spec/ofx/ofx100_spec.rb @@ -0,0 +1,51 @@ +require "spec_helper" + +describe OFX::Parser::OFX100 do + before do + @ofx = OFX::Parser::Base.new("spec/fixtures/v100.ofx") + @parser = @ofx.parser + end + + it "has a version" do + expect(OFX::Parser::OFX100::VERSION).to eql "1.0.0" + end + + it "sets headers" do + expect(@parser.headers).to eql @ofx.headers + end + + it "trims trailing whitespace from headers" do + headers = OFX::Parser::OFX100.parse_headers("VERSION:100 ") + + expect(headers["VERSION"]).to eql "100" + end + + it "sets body" do + expect(@parser.body).to eql @ofx.body + end + + it "sets account" do + expect(@parser.account).to be_a_kind_of(OFX::Account) + end + + it "sets account" do + expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) + end + + it "sets statements" do + expect(@parser.statements.size).to eql 1 + expect(@parser.statements.first).to be_a_kind_of(OFX::Statement) + end + + it "knows about all transaction types" do + valid_types = [ + 'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', + 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER' + ] + expect(valid_types.sort).to eql OFX::Parser::OFX100::TRANSACTION_TYPES.keys.sort + + valid_types.each do |transaction_type| + expect(transaction_type.downcase.to_sym).to eql OFX::Parser::OFX100::TRANSACTION_TYPES[transaction_type] + end + end +end From c7b26191706d3ca751a82201839ee9cca4f2b45b Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Thu, 8 May 2025 16:09:26 -0300 Subject: [PATCH 2/9] fix version --- lib/ofx/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofx/version.rb b/lib/ofx/version.rb index e4031e9..23e096b 100644 --- a/lib/ofx/version.rb +++ b/lib/ofx/version.rb @@ -1,3 +1,3 @@ module OFX - VERSION = '0.4.2'.freeze + VERSION = '0.5.1'.freeze end From e9183a917fbe429618e5ec54c032998e2c38ae1b Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Thu, 8 May 2025 16:11:44 -0300 Subject: [PATCH 3/9] fix gemfile --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 330754f..da8a196 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ofx (0.4.2) + ofx (0.5.1) bigdecimal (= 3.1.8) nkf (= 0.2.0) nokogiri (>= 1.14.5) From 8d6649f6172b6681eb31382c69c1563e8c86e07c Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Thu, 15 May 2025 14:29:14 -0300 Subject: [PATCH 4/9] Refact parser logic to use OFX 1.0.2 for version 100 files. --- lib/ofx.rb | 1 - lib/ofx/parser.rb | 6 ++-- lib/ofx/parser/ofx100.rb | 7 ---- spec/fixtures/v100.ofx | 64 ------------------------------------- spec/ofx/ofx100_spec.rb | 51 ----------------------------- spec/ofx/ofx_parser_spec.rb | 14 ++++++++ 6 files changed, 17 insertions(+), 126 deletions(-) delete mode 100644 lib/ofx/parser/ofx100.rb delete mode 100644 spec/fixtures/v100.ofx delete mode 100644 spec/ofx/ofx100_spec.rb diff --git a/lib/ofx.rb b/lib/ofx.rb index 6dde6e0..f58dcbe 100644 --- a/lib/ofx.rb +++ b/lib/ofx.rb @@ -9,7 +9,6 @@ require 'ofx/errors' require 'ofx/parser' require 'ofx/parser/ofx102' -require 'ofx/parser/ofx100' require 'ofx/parser/ofx103' require 'ofx/parser/ofx211' require 'ofx/foundation' diff --git a/lib/ofx/parser.rb b/lib/ofx/parser.rb index 15bf40c..9c7d399 100644 --- a/lib/ofx/parser.rb +++ b/lib/ofx/parser.rb @@ -17,9 +17,9 @@ def initialize(resource) end case headers["VERSION"] - when /100/ then - @parser = OFX100.new(:headers => headers, :body => body) - when /102/ then + # when /100/ then + # @parser = OFX100.new(:headers => headers, :body => body) + when /102|100/ then @parser = OFX102.new(:headers => headers, :body => body) when /103/ then @parser = OFX103.new(:headers => headers, :body => body) diff --git a/lib/ofx/parser/ofx100.rb b/lib/ofx/parser/ofx100.rb deleted file mode 100644 index 9a2770e..0000000 --- a/lib/ofx/parser/ofx100.rb +++ /dev/null @@ -1,7 +0,0 @@ -module OFX - module Parser - class OFX100 < OFX102 - VERSION = '1.0.0' - end - end -end diff --git a/spec/fixtures/v100.ofx b/spec/fixtures/v100.ofx deleted file mode 100644 index f0b0dc2..0000000 --- a/spec/fixtures/v100.ofx +++ /dev/null @@ -1,64 +0,0 @@ -OFXHEADER:100 -DATA:OFXSGML -VERSION:100 -SECURITY:NONE -ENCODING:UTF-8 -CHARSET:NONE -COMPRESSION:NONE -OLDFILEUID:NONE -NEWFILEUID:NONE - - - - - 0 - INFO - - 20250423150648[-3:BRT] - POR - - PagSeguro Internet S/A - 290 - - - - - - - 0 - INFO - - - BRL - - 290 - 26215973324 - CHECKING - - - 20250414000000[-3:BRT] - 20250423000000[-3:BRT] - - - OUT - 20250414185036[-3:BRT] - -1020.88 - 201505041 - PAGAMENTO TITULO-CNB - - - OUT - 20250414185009[-3:BRT] - -82.10 - 201505051 - TAR PACOTE MENSAL - - - - 3806.63 - 23/04/2025 - - - - - diff --git a/spec/ofx/ofx100_spec.rb b/spec/ofx/ofx100_spec.rb deleted file mode 100644 index c22e4f6..0000000 --- a/spec/ofx/ofx100_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require "spec_helper" - -describe OFX::Parser::OFX100 do - before do - @ofx = OFX::Parser::Base.new("spec/fixtures/v100.ofx") - @parser = @ofx.parser - end - - it "has a version" do - expect(OFX::Parser::OFX100::VERSION).to eql "1.0.0" - end - - it "sets headers" do - expect(@parser.headers).to eql @ofx.headers - end - - it "trims trailing whitespace from headers" do - headers = OFX::Parser::OFX100.parse_headers("VERSION:100 ") - - expect(headers["VERSION"]).to eql "100" - end - - it "sets body" do - expect(@parser.body).to eql @ofx.body - end - - it "sets account" do - expect(@parser.account).to be_a_kind_of(OFX::Account) - end - - it "sets account" do - expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) - end - - it "sets statements" do - expect(@parser.statements.size).to eql 1 - expect(@parser.statements.first).to be_a_kind_of(OFX::Statement) - end - - it "knows about all transaction types" do - valid_types = [ - 'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', - 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER' - ] - expect(valid_types.sort).to eql OFX::Parser::OFX100::TRANSACTION_TYPES.keys.sort - - valid_types.each do |transaction_type| - expect(transaction_type.downcase.to_sym).to eql OFX::Parser::OFX100::TRANSACTION_TYPES[transaction_type] - end - end -end diff --git a/spec/ofx/ofx_parser_spec.rb b/spec/ofx/ofx_parser_spec.rb index 9e1c51a..91bf8e4 100644 --- a/spec/ofx/ofx_parser_spec.rb +++ b/spec/ofx/ofx_parser_spec.rb @@ -47,6 +47,13 @@ }.to raise_error(OFX::UnsupportedFileError) end + it "uses 102 parser to parse version 100 ofx files" do + expect(OFX::Parser::OFX102).to receive(:new).and_return('ofx-102-parser') + + ofx = OFX::Parser::Base.new(ofx_2_example('100')) + expect(ofx.parser).to eql 'ofx-102-parser' + end + it "uses 211 parser to parse version 200 ofx files" do expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') @@ -61,6 +68,13 @@ expect(ofx.parser).to eql 'ofx-211-parser' end + it "uses 211 parser to parse version 220 ofx files" do + expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') + + ofx = OFX::Parser::Base.new(ofx_2_example('220')) + expect(ofx.parser).to eql 'ofx-211-parser' + end + describe "headers" do it "has OFXHEADER" do expect(@ofx.headers["OFXHEADER"]).to eql "100" From 356ea9d1c742ea74c663b7d82e6d44344c6cc6b2 Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Thu, 15 May 2025 14:29:45 -0300 Subject: [PATCH 5/9] fix --- lib/ofx/parser.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/ofx/parser.rb b/lib/ofx/parser.rb index 9c7d399..381bb91 100644 --- a/lib/ofx/parser.rb +++ b/lib/ofx/parser.rb @@ -17,8 +17,6 @@ def initialize(resource) end case headers["VERSION"] - # when /100/ then - # @parser = OFX100.new(:headers => headers, :body => body) when /102|100/ then @parser = OFX102.new(:headers => headers, :body => body) when /103/ then From c2e6cfe064087aaac8e4ec48813ca2a1d16b18ac Mon Sep 17 00:00:00 2001 From: liviazimermann Date: Fri, 16 May 2025 08:56:41 -0300 Subject: [PATCH 6/9] Refact parser to use OFX 1.0.2 for version 1xx files. --- lib/ofx.rb | 1 - lib/ofx/parser.rb | 4 +- lib/ofx/parser/ofx103.rb | 7 ---- spec/fixtures/v103.ofx | 80 ------------------------------------- spec/ofx/ofx103_spec.rb | 51 ----------------------- spec/ofx/ofx_parser_spec.rb | 7 ++++ 6 files changed, 8 insertions(+), 142 deletions(-) delete mode 100644 lib/ofx/parser/ofx103.rb delete mode 100644 spec/fixtures/v103.ofx delete mode 100644 spec/ofx/ofx103_spec.rb diff --git a/lib/ofx.rb b/lib/ofx.rb index f58dcbe..defcc89 100644 --- a/lib/ofx.rb +++ b/lib/ofx.rb @@ -9,7 +9,6 @@ require 'ofx/errors' require 'ofx/parser' require 'ofx/parser/ofx102' -require 'ofx/parser/ofx103' require 'ofx/parser/ofx211' require 'ofx/foundation' require 'ofx/balance' diff --git a/lib/ofx/parser.rb b/lib/ofx/parser.rb index 381bb91..0c56ac3 100644 --- a/lib/ofx/parser.rb +++ b/lib/ofx/parser.rb @@ -17,10 +17,8 @@ def initialize(resource) end case headers["VERSION"] - when /102|100/ then + when /102|100|103/ then @parser = OFX102.new(:headers => headers, :body => body) - when /103/ then - @parser = OFX103.new(:headers => headers, :body => body) when /200|202|211|220/ then @parser = OFX211.new(:headers => headers, :body => body) else diff --git a/lib/ofx/parser/ofx103.rb b/lib/ofx/parser/ofx103.rb deleted file mode 100644 index 13aad78..0000000 --- a/lib/ofx/parser/ofx103.rb +++ /dev/null @@ -1,7 +0,0 @@ -module OFX - module Parser - class OFX103 < OFX102 - VERSION = '1.0.3' - end - end -end diff --git a/spec/fixtures/v103.ofx b/spec/fixtures/v103.ofx deleted file mode 100644 index d02df24..0000000 --- a/spec/fixtures/v103.ofx +++ /dev/null @@ -1,80 +0,0 @@ - - -OFXHEADER:100 -DATA:OFXSGML -VERSION:103 -SECURITY:NONE -ENCODING:USASCII -CHARSET:1252 -COMPRESSION:NONE -OLDFILEUID:NONE -NEWFILEUID:NONE - - - - - - 0 - INFO - - 20150507164333.979[-0300:BRT] - POR - - HSBC Bank Brasil S.A. - 1 - - - - - - 1 - - 0 - INFO - - - BRL - - 399 - 26215973324 - CHECKING - - - 20150501 - 20150507 - - - PAYMENT - 20150504120000 - 20150504120000 - -1020.88 - 201505041 - 0390003 - PAGAMENTO TITULO-CNB - PAGAMENTO TITULO-CNB - - - - PAYMENT - 20150505120000 - 20150505120000 - -82.10 - 201505051 - 0000000 - TAR PACOTE MENSAL - TAR PACOTE MENSAL - - - - - 3806.63 - 20150507164333.980[-0300:BRT] - - - 3806.63 - 20150507164333.980[-0300:BRT] - - - - - diff --git a/spec/ofx/ofx103_spec.rb b/spec/ofx/ofx103_spec.rb deleted file mode 100644 index 754353c..0000000 --- a/spec/ofx/ofx103_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require "spec_helper" - -describe OFX::Parser::OFX103 do - before do - @ofx = OFX::Parser::Base.new("spec/fixtures/v103.ofx") - @parser = @ofx.parser - end - - it "has a version" do - expect(OFX::Parser::OFX103::VERSION).to eql "1.0.3" - end - - it "sets headers" do - expect(@parser.headers).to eql @ofx.headers - end - - it "trims trailing whitespace from headers" do - headers = OFX::Parser::OFX103.parse_headers("VERSION:103 ") - - expect(headers["VERSION"]).to eql "103" - end - - it "sets body" do - expect(@parser.body).to eql @ofx.body - end - - it "sets account" do - expect(@parser.account).to be_a_kind_of(OFX::Account) - end - - it "sets account" do - expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) - end - - it "sets statements" do - expect(@parser.statements.size).to eql 1 - expect(@parser.statements.first).to be_a_kind_of(OFX::Statement) - end - - it "knows about all transaction types" do - valid_types = [ - 'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', - 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER' - ] - expect(valid_types.sort).to eql OFX::Parser::OFX103::TRANSACTION_TYPES.keys.sort - - valid_types.each do |transaction_type| - expect(transaction_type.downcase.to_sym).to eql OFX::Parser::OFX103::TRANSACTION_TYPES[transaction_type] - end - end -end diff --git a/spec/ofx/ofx_parser_spec.rb b/spec/ofx/ofx_parser_spec.rb index 91bf8e4..63b96f0 100644 --- a/spec/ofx/ofx_parser_spec.rb +++ b/spec/ofx/ofx_parser_spec.rb @@ -54,6 +54,13 @@ expect(ofx.parser).to eql 'ofx-102-parser' end + it "uses 102 parser to parse version 103 ofx files" do + expect(OFX::Parser::OFX102).to receive(:new).and_return('ofx-102-parser') + + ofx = OFX::Parser::Base.new(ofx_2_example('103')) + expect(ofx.parser).to eql 'ofx-102-parser' + end + it "uses 211 parser to parse version 200 ofx files" do expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') From 156445a5ff5b678501cf3648dfa897de31c80f5b Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Fri, 16 May 2025 10:51:14 -0300 Subject: [PATCH 7/9] Update gem version --- Gemfile.lock | 8 ++++---- lib/ofx/version.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index da8a196..3c7dfb6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ofx (0.5.1) + ofx (0.5.2) bigdecimal (= 3.1.8) nkf (= 0.2.0) nokogiri (>= 1.14.5) @@ -34,11 +34,11 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) lumberjack (1.2.10) method_source (1.1.0) - mini_portile2 (2.8.7) + mini_portile2 (2.8.9) nenv (0.3.0) nkf (0.2.0) - nokogiri (1.14.5) - mini_portile2 (~> 2.8.0) + nokogiri (1.15.7) + mini_portile2 (~> 2.8.2) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) diff --git a/lib/ofx/version.rb b/lib/ofx/version.rb index 23e096b..8dfde40 100644 --- a/lib/ofx/version.rb +++ b/lib/ofx/version.rb @@ -1,3 +1,3 @@ module OFX - VERSION = '0.5.1'.freeze + VERSION = '0.5.2'.freeze end From 6a085c884b18b57d22ac637f4b8c380f11053e4b Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Fri, 16 May 2025 11:02:44 -0300 Subject: [PATCH 8/9] Refact --- spec/ofx/ofx_parser_spec.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/ofx/ofx_parser_spec.rb b/spec/ofx/ofx_parser_spec.rb index 63b96f0..df7fe2c 100644 --- a/spec/ofx/ofx_parser_spec.rb +++ b/spec/ofx/ofx_parser_spec.rb @@ -1,6 +1,17 @@ require "spec_helper" describe OFX::Parser do + def ofx_2_example(version) + <<~OFX_CONTENT + + + " + + + + OFX_CONTENT + end + before do @ofx = OFX::Parser::Base.new("spec/fixtures/sample.ofx") end @@ -132,13 +143,4 @@ expect(@ofx.headers.size).to be(9) end end - - def ofx_2_example(version) - <<-EndOfx - -" - - - EndOfx - end end From 29337a45178c656b33c6d90450d29663823cb6d5 Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Fri, 16 May 2025 11:07:19 -0300 Subject: [PATCH 9/9] Fix --- spec/ofx/ofx_parser_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/ofx/ofx_parser_spec.rb b/spec/ofx/ofx_parser_spec.rb index df7fe2c..32a916e 100644 --- a/spec/ofx/ofx_parser_spec.rb +++ b/spec/ofx/ofx_parser_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" describe OFX::Parser do - def ofx_2_example(version) + def ofx_example_to(version) <<~OFX_CONTENT @@ -61,35 +61,35 @@ def ofx_2_example(version) it "uses 102 parser to parse version 100 ofx files" do expect(OFX::Parser::OFX102).to receive(:new).and_return('ofx-102-parser') - ofx = OFX::Parser::Base.new(ofx_2_example('100')) + ofx = OFX::Parser::Base.new(ofx_example_to('100')) expect(ofx.parser).to eql 'ofx-102-parser' end it "uses 102 parser to parse version 103 ofx files" do expect(OFX::Parser::OFX102).to receive(:new).and_return('ofx-102-parser') - ofx = OFX::Parser::Base.new(ofx_2_example('103')) + ofx = OFX::Parser::Base.new(ofx_example_to('103')) expect(ofx.parser).to eql 'ofx-102-parser' end it "uses 211 parser to parse version 200 ofx files" do expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') - ofx = OFX::Parser::Base.new(ofx_2_example('200')) + ofx = OFX::Parser::Base.new(ofx_example_to('200')) expect(ofx.parser).to eql 'ofx-211-parser' end it "uses 211 parser to parse version 202 ofx files" do expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') - ofx = OFX::Parser::Base.new(ofx_2_example('202')) + ofx = OFX::Parser::Base.new(ofx_example_to('202')) expect(ofx.parser).to eql 'ofx-211-parser' end it "uses 211 parser to parse version 220 ofx files" do expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') - ofx = OFX::Parser::Base.new(ofx_2_example('220')) + ofx = OFX::Parser::Base.new(ofx_example_to('220')) expect(ofx.parser).to eql 'ofx-211-parser' end