ibandit 0.11.22 → 0.11.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +4 -1
- data/.rubocop_todo.yml +13 -60
- data/.travis.yml +0 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +6 -0
- data/ibandit.gemspec +2 -2
- data/lib/ibandit.rb +3 -3
- data/lib/ibandit/german_details_converter.rb +3 -3
- data/lib/ibandit/iban.rb +8 -0
- data/lib/ibandit/sweden/bank_lookup.rb +1 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/german_details_converter_spec.rb +5 -9
- data/spec/ibandit/iban_assembler_spec.rb +0 -87
- data/spec/ibandit/iban_spec.rb +131 -173
- data/spec/ibandit/iban_splitter_spec.rb +0 -4
- data/spec/ibandit/local_details_cleaner_spec.rb +0 -128
- data/spec/ibandit/structure_spec.rb +1 -1
- data/spec/ibandit/sweden/validator_spec.rb +0 -33
- metadata +17 -17
|
@@ -8,19 +8,16 @@ describe Ibandit::Sweden::Validator do
|
|
|
8
8
|
|
|
9
9
|
context "without a clearing code" do
|
|
10
10
|
let(:clearing_code) { nil }
|
|
11
|
-
|
|
12
11
|
it { is_expected.to eq(false) }
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
context "with an impossible clearing code" do
|
|
16
15
|
let(:clearing_code) { "1001" }
|
|
17
|
-
|
|
18
16
|
it { is_expected.to eq(false) }
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
context "with a possible clearing code" do
|
|
22
20
|
let(:clearing_code) { "1101" }
|
|
23
|
-
|
|
24
21
|
it { is_expected.to eq(true) }
|
|
25
22
|
end
|
|
26
23
|
end
|
|
@@ -30,31 +27,26 @@ describe Ibandit::Sweden::Validator do
|
|
|
30
27
|
|
|
31
28
|
context "without a clearing code" do
|
|
32
29
|
let(:clearing_code) { nil }
|
|
33
|
-
|
|
34
30
|
it { is_expected.to eq(nil) }
|
|
35
31
|
end
|
|
36
32
|
|
|
37
33
|
context "with an impossible clearing code" do
|
|
38
34
|
let(:clearing_code) { "1001" }
|
|
39
|
-
|
|
40
35
|
it { is_expected.to eq(nil) }
|
|
41
36
|
end
|
|
42
37
|
|
|
43
38
|
context "with a correct length 4-digit clearing code" do
|
|
44
39
|
let(:clearing_code) { "1101" }
|
|
45
|
-
|
|
46
40
|
it { is_expected.to eq(true) }
|
|
47
41
|
end
|
|
48
42
|
|
|
49
43
|
context "with a correct length 5-digit clearing code" do
|
|
50
44
|
let(:clearing_code) { "80001" }
|
|
51
|
-
|
|
52
45
|
it { is_expected.to eq(true) }
|
|
53
46
|
end
|
|
54
47
|
|
|
55
48
|
context "with an incorrect length 5-digit clearing code" do
|
|
56
49
|
let(:clearing_code) { "40001" }
|
|
57
|
-
|
|
58
50
|
it { is_expected.to eq(false) }
|
|
59
51
|
end
|
|
60
52
|
end
|
|
@@ -68,49 +60,42 @@ describe Ibandit::Sweden::Validator do
|
|
|
68
60
|
context "without a clearing code" do
|
|
69
61
|
let(:clearing_code) { nil }
|
|
70
62
|
let(:serial_number) { "1234567" }
|
|
71
|
-
|
|
72
63
|
it { is_expected.to eq(nil) }
|
|
73
64
|
end
|
|
74
65
|
|
|
75
66
|
context "with an impossible clearing code" do
|
|
76
67
|
let(:clearing_code) { "1001" }
|
|
77
68
|
let(:serial_number) { "1234567" }
|
|
78
|
-
|
|
79
69
|
it { is_expected.to eq(nil) }
|
|
80
70
|
end
|
|
81
71
|
|
|
82
72
|
context "with a correct length serial number" do
|
|
83
73
|
let(:clearing_code) { "1101" }
|
|
84
74
|
let(:serial_number) { "1234567" }
|
|
85
|
-
|
|
86
75
|
it { is_expected.to eq(true) }
|
|
87
76
|
end
|
|
88
77
|
|
|
89
78
|
context "with an incorrect length serial number" do
|
|
90
79
|
let(:clearing_code) { "1101" }
|
|
91
80
|
let(:serial_number) { "123456" }
|
|
92
|
-
|
|
93
81
|
it { is_expected.to eq(false) }
|
|
94
82
|
end
|
|
95
83
|
|
|
96
84
|
context "with a short serial number for a clearing code that zerofills" do
|
|
97
85
|
let(:clearing_code) { "9960" }
|
|
98
86
|
let(:serial_number) { "123456" }
|
|
99
|
-
|
|
100
87
|
it { is_expected.to eq(true) }
|
|
101
88
|
end
|
|
102
89
|
|
|
103
90
|
context "with a long serial number for a clearing code that zerofills" do
|
|
104
91
|
let(:clearing_code) { "9960" }
|
|
105
92
|
let(:serial_number) { "12345678901" }
|
|
106
|
-
|
|
107
93
|
it { is_expected.to eq(false) }
|
|
108
94
|
end
|
|
109
95
|
|
|
110
96
|
context "without a serial number" do
|
|
111
97
|
let(:clearing_code) { "9960" }
|
|
112
98
|
let(:serial_number) { nil }
|
|
113
|
-
|
|
114
99
|
it { is_expected.to eq(false) }
|
|
115
100
|
end
|
|
116
101
|
end
|
|
@@ -120,19 +105,16 @@ describe Ibandit::Sweden::Validator do
|
|
|
120
105
|
|
|
121
106
|
context "without a bank code" do
|
|
122
107
|
let(:bank_code) { nil }
|
|
123
|
-
|
|
124
108
|
it { is_expected.to eq(false) }
|
|
125
109
|
end
|
|
126
110
|
|
|
127
111
|
context "with an impossible bank code" do
|
|
128
112
|
let(:bank_code) { "123" }
|
|
129
|
-
|
|
130
113
|
it { is_expected.to eq(false) }
|
|
131
114
|
end
|
|
132
115
|
|
|
133
116
|
context "with a possible bank code" do
|
|
134
117
|
let(:bank_code) { "120" }
|
|
135
|
-
|
|
136
118
|
it { is_expected.to eq(true) }
|
|
137
119
|
end
|
|
138
120
|
end
|
|
@@ -148,21 +130,18 @@ describe Ibandit::Sweden::Validator do
|
|
|
148
130
|
context "without a bank code" do
|
|
149
131
|
let(:account_number) { "12810105723" }
|
|
150
132
|
let(:bank_code) { nil }
|
|
151
|
-
|
|
152
133
|
it { is_expected.to eq(nil) }
|
|
153
134
|
end
|
|
154
135
|
|
|
155
136
|
context "with an impossible bank code" do
|
|
156
137
|
let(:account_number) { "12810105723" }
|
|
157
138
|
let(:bank_code) { "500" }
|
|
158
|
-
|
|
159
139
|
it { is_expected.to eq(false) }
|
|
160
140
|
end
|
|
161
141
|
|
|
162
142
|
context "with a possible bank code" do
|
|
163
143
|
let(:account_number) { "12810105723" }
|
|
164
144
|
let(:bank_code) { "120" }
|
|
165
|
-
|
|
166
145
|
it { is_expected.to eq(true) }
|
|
167
146
|
end
|
|
168
147
|
end
|
|
@@ -178,34 +157,29 @@ describe Ibandit::Sweden::Validator do
|
|
|
178
157
|
context "without a bank code" do
|
|
179
158
|
let(:account_number) { "12810105723" }
|
|
180
159
|
let(:bank_code) { nil }
|
|
181
|
-
|
|
182
160
|
it { is_expected.to eq(nil) }
|
|
183
161
|
end
|
|
184
162
|
|
|
185
163
|
context "with an impossible bank code" do
|
|
186
164
|
let(:account_number) { "12810105723" }
|
|
187
165
|
let(:bank_code) { "500" }
|
|
188
|
-
|
|
189
166
|
it { is_expected.to eq(nil) }
|
|
190
167
|
end
|
|
191
168
|
|
|
192
169
|
context "with a normal type-1 account number" do
|
|
193
170
|
let(:account_number) { "00000054391024039" }
|
|
194
171
|
let(:bank_code) { "500" }
|
|
195
|
-
|
|
196
172
|
it { is_expected.to eq(true) }
|
|
197
173
|
|
|
198
174
|
context "that has a 6 digit serial number" do
|
|
199
175
|
let(:account_number) { "00000005439102403" }
|
|
200
176
|
let(:bank_code) { "500" }
|
|
201
|
-
|
|
202
177
|
it { is_expected.to eq(false) }
|
|
203
178
|
end
|
|
204
179
|
|
|
205
180
|
context "that has an 8 digit serial number" do
|
|
206
181
|
let(:account_number) { "00000543910240391" }
|
|
207
182
|
let(:bank_code) { "500" }
|
|
208
|
-
|
|
209
183
|
it { is_expected.to eq(false) }
|
|
210
184
|
end
|
|
211
185
|
end
|
|
@@ -213,13 +187,11 @@ describe Ibandit::Sweden::Validator do
|
|
|
213
187
|
context "with a Danske bank account" do
|
|
214
188
|
let(:account_number) { "12810105723" }
|
|
215
189
|
let(:bank_code) { "120" }
|
|
216
|
-
|
|
217
190
|
it { is_expected.to eq(true) }
|
|
218
191
|
|
|
219
192
|
context "that has an 8 digit serial number" do
|
|
220
193
|
let(:account_number) { "00000128101057231" }
|
|
221
194
|
let(:bank_code) { "120" }
|
|
222
|
-
|
|
223
195
|
it { is_expected.to eq(false) }
|
|
224
196
|
end
|
|
225
197
|
|
|
@@ -228,7 +200,6 @@ describe Ibandit::Sweden::Validator do
|
|
|
228
200
|
let(:bank_code) { "120" }
|
|
229
201
|
# This passes because it could be a 10 digit account number from the
|
|
230
202
|
# clearing code range 9180-9189.
|
|
231
|
-
|
|
232
203
|
it { is_expected.to eq(true) }
|
|
233
204
|
end
|
|
234
205
|
end
|
|
@@ -236,18 +207,15 @@ describe Ibandit::Sweden::Validator do
|
|
|
236
207
|
context "with a Handelsbanken account number" do
|
|
237
208
|
let(:bank_code) { "600" }
|
|
238
209
|
let(:account_number) { "00000000219161038" }
|
|
239
|
-
|
|
240
210
|
it { is_expected.to eq(true) }
|
|
241
211
|
|
|
242
212
|
context "that is only 8 characters long" do
|
|
243
213
|
let(:account_number) { "00000000021916103" }
|
|
244
|
-
|
|
245
214
|
it { is_expected.to eq(true) }
|
|
246
215
|
end
|
|
247
216
|
|
|
248
217
|
context "that is 10 characters long" do
|
|
249
218
|
let(:account_number) { "00000002191610381" }
|
|
250
|
-
|
|
251
219
|
it { is_expected.to eq(false) }
|
|
252
220
|
end
|
|
253
221
|
end
|
|
@@ -255,7 +223,6 @@ describe Ibandit::Sweden::Validator do
|
|
|
255
223
|
context "without a Nordea PlusGirot account number" do
|
|
256
224
|
let(:bank_code) { "950" }
|
|
257
225
|
let(:account_number) { "00099603401258276" }
|
|
258
|
-
|
|
259
226
|
it { is_expected.to eq(true) }
|
|
260
227
|
end
|
|
261
228
|
end
|
metadata
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ibandit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.23
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GoCardless
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-12-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: gc_ruboconfig
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 2.3.11
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: 2.3.11
|
|
27
13
|
- !ruby/object:Gem::Dependency
|
|
28
14
|
name: nokogiri
|
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -94,6 +80,20 @@ dependencies:
|
|
|
94
80
|
- - "~>"
|
|
95
81
|
- !ruby/object:Gem::Version
|
|
96
82
|
version: '1.2'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rubocop
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.52.0
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.52.0
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: sax-machine
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
210
210
|
version: '0'
|
|
211
211
|
requirements: []
|
|
212
212
|
rubyforge_project:
|
|
213
|
-
rubygems_version: 2.
|
|
213
|
+
rubygems_version: 2.7.3
|
|
214
214
|
signing_key:
|
|
215
215
|
specification_version: 4
|
|
216
216
|
summary: Convert national banking details into IBANs, and vice-versa.
|