banking_data 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,7 +35,7 @@ class BankingData::AustrianBank < BankingData::Bank
35
35
 
36
36
  def file
37
37
  File.dirname(__FILE__) +
38
- '/../../data/SEPA-ZV-VZ_gesamt_de_1615904610976.csv'
38
+ '/../../data/SEPA-ZV-VZ_gesamt_de_1642675944518_alte_Version.csv'
39
39
  end
40
40
 
41
41
  def opts
@@ -23,9 +23,9 @@ class BankingData::DutchBank < BankingData::Bank
23
23
  def get_all
24
24
  banks = []
25
25
  SmarterCSV.process(file, opts).each do |line|
26
- bank_id = line[:bank_identifier].to_s
26
+ bank_id = line[:identifier].to_s
27
27
  bic = line[:bic]
28
- name = line[:naam_bank].to_s
28
+ name = line[:naam_betaaldienstverlener].to_s
29
29
  if bank_id && bic && name
30
30
  banks << new(name: name, bank_id: bank_id, bic: bic)
31
31
  end
@@ -31,7 +31,7 @@ class BankingData::GermanBank < BankingData::Bank
31
31
  end
32
32
 
33
33
  def file
34
- File.dirname(__FILE__) + '/../../data/blz_2021_03_16.txt'
34
+ File.dirname(__FILE__) + '/../../data/blz_2021_12_06.txt'
35
35
  end
36
36
  end
37
37
  end
@@ -1,4 +1,4 @@
1
1
  module BankingData
2
2
  # banking_data version
3
- VERSION = '0.9.4'
3
+ VERSION = '0.9.5'
4
4
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module BankingData
4
4
  describe AustrianBank do
5
5
  describe 'end-to-end test' do
6
- ['RCNOATW1XXX', 'FFBKDEFFAUT'].each do |bic|
6
+ ['RCNOATW1XXX', 'EUAAATWWXXX'].each do |bic|
7
7
  it "includes #{bic}" do
8
8
  expect(AustrianBank.only(:bic).map(&:first)).to include(bic)
9
9
  expect(Bank.where(locale: :at).only(:bic).map(&:first))
@@ -21,6 +21,21 @@ module BankingData
21
21
  .to eq([blz])
22
22
  end
23
23
  end
24
+
25
+ it 'all bics are blank or look like bics' do
26
+ bics = AustrianBank.only(:bic).map(&:first)
27
+ # regular expression: the bic should have 11 characters, that are either
28
+ # all white space or consist of capital letters and digits
29
+ expect(bics.select{ |bic| !( bic =~ /\A(\s|([A-Z]|\d)){11}\z/ ) }).
30
+ to eq([])
31
+ end
32
+
33
+ it 'all blz except two exceptions consist of 5 digits' do
34
+ exceptions = ['1000', '100']
35
+ blzs = AustrianBank.only(:blz).map(&:first) - exceptions
36
+ expect(blzs.select{ |blz| !( blz =~ /\A\d{5}\z/ ) }).
37
+ to eq([])
38
+ end
24
39
  end
25
40
  end
26
41
  end
@@ -11,5 +11,30 @@ module BankingData
11
11
  end
12
12
  end
13
13
  end
14
+
15
+ it 'all but one bics are blank or look like bics' do
16
+ exceptions = ['BOFSNL21002']
17
+ bics = DutchBank.only(:bic).map(&:first) - exceptions
18
+ # regular expression: the bic should have 8 characters, that are either
19
+ # all white space or consist of capital letters and digits
20
+ expect(bics.select{ |bic| !( bic =~ /\A(\s|([A-Z]|\d)){8}\z/ ) }).
21
+ to eq([])
22
+ end
23
+
24
+ it 'all bank identifiers consist of 4 capital letters' do
25
+ bank_ids = DutchBank.only(:bank_id).map(&:first)
26
+ # regular expression: the bic should have 8 characters, that are either
27
+ # all white space or consist of capital letters and digits
28
+ expect(bank_ids.select{ |bank_id| !( bank_id =~ /\A[A-Z]{4}\z/ ) }).
29
+ to eq([])
30
+ end
31
+
32
+ it 'all bank names have at least one letter' do
33
+ names = DutchBank.only(:name).map(&:first)
34
+ # regular expression: the bic should have 8 characters, that are either
35
+ # all white space or consist of capital letters and digits
36
+ expect(names.select{ |name| !( name =~ /\A.*[a-zA-Z]+.*\z/ ) }).
37
+ to eq([])
38
+ end
14
39
  end
15
40
  end
@@ -22,6 +22,20 @@ module BankingData
22
22
  .to eq([blz])
23
23
  end
24
24
  end
25
+
26
+ it 'all bics are blank or look like bics' do
27
+ bics = GermanBank.only(:bic).map(&:first)
28
+ # regular expression: the bic should have 11 characters, that are either
29
+ # all white space or consist of capital letters and digits
30
+ expect(bics.select{ |bic| !( bic =~ /\A(\s|([A-Z]|\d)){11}\z/ ) }).
31
+ to eq([])
32
+ end
33
+
34
+ it 'all blz consist of 8 digits' do
35
+ blzs = GermanBank.only(:blz).map(&:first)
36
+ expect(blzs.select{ |blz| !( blz =~ /\A\d{8}\z/ ) }).
37
+ to eq([])
38
+ end
25
39
  end
26
40
  end
27
41
  end
@@ -3,13 +3,21 @@ require 'spec_helper'
3
3
  module BankingData
4
4
  describe SwissBank do
5
5
  describe 'end-to-end test' do
6
- ['SNBZCHZZXXX', 'UBSWCHZH31A'].each do |bic|
6
+ ['SNBZCHZZXXX', 'UBSWCHZH31A', 'VBBECH22XXX'].each do |bic|
7
7
  it "includes #{bic}" do
8
8
  expect(SwissBank.only(:bic).map(&:first)).to include(bic)
9
9
  expect(Bank.where(locale: :ch).only(:bic).map(&:first))
10
10
  .to include(bic)
11
11
  end
12
12
  end
13
+
14
+ it 'all bics are blank or look like bics' do
15
+ bics = SwissBank.only(:bic).map(&:first)
16
+ # regular expression: the bic should have 11 characters, that are either
17
+ # all white space or consist of capital letters and digits
18
+ expect(bics.select{ |bic| !( bic =~ /\A(\s|([A-Z]|\d)){11}\z/ ) }).
19
+ to eq([])
20
+ end
13
21
  end
14
22
  end
15
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banking_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank C. Eckert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-17 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: smarter_csv
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.1.0
47
+ version: 1.2.9
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.1.0
54
+ version: 1.2.9
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +137,8 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: This gem exposes the official banking data of the respective national
140
- banks of Germany, Austria and Switzerland, including bank codes and SWIFT-codes/BICs.
140
+ banks of Germany, Austria, Netherlands and Switzerland, including bank codes and
141
+ SWIFT-codes/BICs.
141
142
  email: frank.eckert@boost-project.com
142
143
  executables: []
143
144
  extensions: []
@@ -156,9 +157,9 @@ files:
156
157
  - banking_data.gemspec
157
158
  - data/BIC-lijst-NL.csv
158
159
  - data/README.md
159
- - data/SEPA-ZV-VZ_gesamt_de_1615904610976.csv
160
+ - data/SEPA-ZV-VZ_gesamt_de_1642675944518_alte_Version.csv
160
161
  - data/bcbankenstamm.txt
161
- - data/blz_2021_03_16.txt
162
+ - data/blz_2021_12_06.txt
162
163
  - gemfiles/rails_3.0.gemfile
163
164
  - gemfiles/rails_4.0.gemfile
164
165
  - gemfiles/rails_4.2.gemfile
@@ -190,19 +191,19 @@ require_paths:
190
191
  - lib
191
192
  required_ruby_version: !ruby/object:Gem::Requirement
192
193
  requirements:
193
- - - "<"
194
+ - - ">="
194
195
  - !ruby/object:Gem::Version
195
- version: '3'
196
+ version: '0'
196
197
  required_rubygems_version: !ruby/object:Gem::Requirement
197
198
  requirements:
198
199
  - - ">="
199
200
  - !ruby/object:Gem::Version
200
201
  version: '0'
201
202
  requirements: []
202
- rubygems_version: 3.0.8
203
+ rubygems_version: 3.1.4
203
204
  signing_key:
204
205
  specification_version: 4
205
- summary: Banking data for German, Austrian and Swiss banks
206
+ summary: Banking data for German, Austrian, Dutch and Swiss banks
206
207
  test_files:
207
208
  - spec/banking_data/austrian_bank_spec.rb
208
209
  - spec/banking_data/bank_spec.rb