ibandit 0.11.19 → 0.11.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe "structures.yml" do
4
- FILE = File.expand_path("../../../data/structures.yml", __FILE__)
4
+ FILE = File.expand_path("../../data/structures.yml", __dir__)
5
5
  STRUCTURES = YAML.load_file(FILE)
6
6
 
7
7
  STRUCTURES.each do |country, rules|
@@ -8,16 +8,19 @@ describe Ibandit::Sweden::Validator do
8
8
 
9
9
  context "without a clearing code" do
10
10
  let(:clearing_code) { nil }
11
+
11
12
  it { is_expected.to eq(false) }
12
13
  end
13
14
 
14
15
  context "with an impossible clearing code" do
15
16
  let(:clearing_code) { "1001" }
17
+
16
18
  it { is_expected.to eq(false) }
17
19
  end
18
20
 
19
21
  context "with a possible clearing code" do
20
22
  let(:clearing_code) { "1101" }
23
+
21
24
  it { is_expected.to eq(true) }
22
25
  end
23
26
  end
@@ -27,26 +30,31 @@ describe Ibandit::Sweden::Validator do
27
30
 
28
31
  context "without a clearing code" do
29
32
  let(:clearing_code) { nil }
33
+
30
34
  it { is_expected.to eq(nil) }
31
35
  end
32
36
 
33
37
  context "with an impossible clearing code" do
34
38
  let(:clearing_code) { "1001" }
39
+
35
40
  it { is_expected.to eq(nil) }
36
41
  end
37
42
 
38
43
  context "with a correct length 4-digit clearing code" do
39
44
  let(:clearing_code) { "1101" }
45
+
40
46
  it { is_expected.to eq(true) }
41
47
  end
42
48
 
43
49
  context "with a correct length 5-digit clearing code" do
44
50
  let(:clearing_code) { "80001" }
51
+
45
52
  it { is_expected.to eq(true) }
46
53
  end
47
54
 
48
55
  context "with an incorrect length 5-digit clearing code" do
49
56
  let(:clearing_code) { "40001" }
57
+
50
58
  it { is_expected.to eq(false) }
51
59
  end
52
60
  end
@@ -60,42 +68,49 @@ describe Ibandit::Sweden::Validator do
60
68
  context "without a clearing code" do
61
69
  let(:clearing_code) { nil }
62
70
  let(:serial_number) { "1234567" }
71
+
63
72
  it { is_expected.to eq(nil) }
64
73
  end
65
74
 
66
75
  context "with an impossible clearing code" do
67
76
  let(:clearing_code) { "1001" }
68
77
  let(:serial_number) { "1234567" }
78
+
69
79
  it { is_expected.to eq(nil) }
70
80
  end
71
81
 
72
82
  context "with a correct length serial number" do
73
83
  let(:clearing_code) { "1101" }
74
84
  let(:serial_number) { "1234567" }
85
+
75
86
  it { is_expected.to eq(true) }
76
87
  end
77
88
 
78
89
  context "with an incorrect length serial number" do
79
90
  let(:clearing_code) { "1101" }
80
91
  let(:serial_number) { "123456" }
92
+
81
93
  it { is_expected.to eq(false) }
82
94
  end
83
95
 
84
96
  context "with a short serial number for a clearing code that zerofills" do
85
97
  let(:clearing_code) { "9960" }
86
98
  let(:serial_number) { "123456" }
99
+
87
100
  it { is_expected.to eq(true) }
88
101
  end
89
102
 
90
103
  context "with a long serial number for a clearing code that zerofills" do
91
104
  let(:clearing_code) { "9960" }
92
105
  let(:serial_number) { "12345678901" }
106
+
93
107
  it { is_expected.to eq(false) }
94
108
  end
95
109
 
96
110
  context "without a serial number" do
97
111
  let(:clearing_code) { "9960" }
98
112
  let(:serial_number) { nil }
113
+
99
114
  it { is_expected.to eq(false) }
100
115
  end
101
116
  end
@@ -105,16 +120,19 @@ describe Ibandit::Sweden::Validator do
105
120
 
106
121
  context "without a bank code" do
107
122
  let(:bank_code) { nil }
123
+
108
124
  it { is_expected.to eq(false) }
109
125
  end
110
126
 
111
127
  context "with an impossible bank code" do
112
128
  let(:bank_code) { "123" }
129
+
113
130
  it { is_expected.to eq(false) }
114
131
  end
115
132
 
116
133
  context "with a possible bank code" do
117
134
  let(:bank_code) { "120" }
135
+
118
136
  it { is_expected.to eq(true) }
119
137
  end
120
138
  end
@@ -130,18 +148,21 @@ describe Ibandit::Sweden::Validator do
130
148
  context "without a bank code" do
131
149
  let(:account_number) { "12810105723" }
132
150
  let(:bank_code) { nil }
151
+
133
152
  it { is_expected.to eq(nil) }
134
153
  end
135
154
 
136
155
  context "with an impossible bank code" do
137
156
  let(:account_number) { "12810105723" }
138
157
  let(:bank_code) { "500" }
158
+
139
159
  it { is_expected.to eq(false) }
140
160
  end
141
161
 
142
162
  context "with a possible bank code" do
143
163
  let(:account_number) { "12810105723" }
144
164
  let(:bank_code) { "120" }
165
+
145
166
  it { is_expected.to eq(true) }
146
167
  end
147
168
  end
@@ -157,29 +178,34 @@ describe Ibandit::Sweden::Validator do
157
178
  context "without a bank code" do
158
179
  let(:account_number) { "12810105723" }
159
180
  let(:bank_code) { nil }
181
+
160
182
  it { is_expected.to eq(nil) }
161
183
  end
162
184
 
163
185
  context "with an impossible bank code" do
164
186
  let(:account_number) { "12810105723" }
165
187
  let(:bank_code) { "500" }
188
+
166
189
  it { is_expected.to eq(nil) }
167
190
  end
168
191
 
169
192
  context "with a normal type-1 account number" do
170
193
  let(:account_number) { "00000054391024039" }
171
194
  let(:bank_code) { "500" }
195
+
172
196
  it { is_expected.to eq(true) }
173
197
 
174
198
  context "that has a 6 digit serial number" do
175
199
  let(:account_number) { "00000005439102403" }
176
200
  let(:bank_code) { "500" }
201
+
177
202
  it { is_expected.to eq(false) }
178
203
  end
179
204
 
180
205
  context "that has an 8 digit serial number" do
181
206
  let(:account_number) { "00000543910240391" }
182
207
  let(:bank_code) { "500" }
208
+
183
209
  it { is_expected.to eq(false) }
184
210
  end
185
211
  end
@@ -187,11 +213,13 @@ describe Ibandit::Sweden::Validator do
187
213
  context "with a Danske bank account" do
188
214
  let(:account_number) { "12810105723" }
189
215
  let(:bank_code) { "120" }
216
+
190
217
  it { is_expected.to eq(true) }
191
218
 
192
219
  context "that has an 8 digit serial number" do
193
220
  let(:account_number) { "00000128101057231" }
194
221
  let(:bank_code) { "120" }
222
+
195
223
  it { is_expected.to eq(false) }
196
224
  end
197
225
 
@@ -200,6 +228,7 @@ describe Ibandit::Sweden::Validator do
200
228
  let(:bank_code) { "120" }
201
229
  # This passes because it could be a 10 digit account number from the
202
230
  # clearing code range 9180-9189.
231
+
203
232
  it { is_expected.to eq(true) }
204
233
  end
205
234
  end
@@ -207,15 +236,18 @@ describe Ibandit::Sweden::Validator do
207
236
  context "with a Handelsbanken account number" do
208
237
  let(:bank_code) { "600" }
209
238
  let(:account_number) { "00000000219161038" }
239
+
210
240
  it { is_expected.to eq(true) }
211
241
 
212
242
  context "that is only 8 characters long" do
213
243
  let(:account_number) { "00000000021916103" }
244
+
214
245
  it { is_expected.to eq(true) }
215
246
  end
216
247
 
217
248
  context "that is 10 characters long" do
218
249
  let(:account_number) { "00000002191610381" }
250
+
219
251
  it { is_expected.to eq(false) }
220
252
  end
221
253
  end
@@ -223,6 +255,7 @@ describe Ibandit::Sweden::Validator do
223
255
  context "without a Nordea PlusGirot account number" do
224
256
  let(:bank_code) { "950" }
225
257
  let(:account_number) { "00099603401258276" }
258
+
226
259
  it { is_expected.to eq(true) }
227
260
  end
228
261
  end
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.19
4
+ version: 0.11.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-15 00:00:00.000000000 Z
11
+ date: 2018-10-18 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
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: nokogiri
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ~>
31
+ - - "~>"
18
32
  - !ruby/object:Gem::Version
19
33
  version: '1.6'
20
34
  type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ~>
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
40
  version: '1.6'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: pry
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - ~>
45
+ - - "~>"
32
46
  - !ruby/object:Gem::Version
33
47
  version: '0.10'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - ~>
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0.10'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: pry-nav
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ~>
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0.2'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - ~>
66
+ - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0.2'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ~>
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
75
  version: '3.3'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ~>
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '3.3'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rspec-its
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ~>
87
+ - - "~>"
74
88
  - !ruby/object:Gem::Version
75
89
  version: '1.2'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - ~>
94
+ - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  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
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.3'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: i18n
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: Ibandit is a Ruby library for manipulating and validating IBANs. It allows
@@ -131,10 +131,10 @@ executables: []
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
- - .gitignore
135
- - .rubocop.yml
136
- - .rubocop_todo.yml
137
- - .travis.yml
134
+ - ".gitignore"
135
+ - ".rubocop.yml"
136
+ - ".rubocop_todo.yml"
137
+ - ".travis.yml"
138
138
  - CHANGELOG.md
139
139
  - Gemfile
140
140
  - LICENSE
@@ -200,17 +200,17 @@ require_paths:
200
200
  - lib
201
201
  required_ruby_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
- - - '>='
203
+ - - ">="
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  requirements:
208
- - - '>='
208
+ - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.0.14.1
213
+ rubygems_version: 2.6.14
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: Convert national banking details into IBANs, and vice-versa.