ibandit 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/config/locales/de.yml +11 -0
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +118 -0
- data/spec/spec_helper.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ae537cad4cd046f626011aed09d607eecdf1db
|
4
|
+
data.tar.gz: ba08d25b835cab339e303d060e2538f397e3caf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d097224eae7040a20501c70d5d6dab86e8de5df4ad4158aa96d7403a652b5a9713f162ec772220fac7f10accbf8d7570d6c1be0a74b91c9206115c2af9439286
|
7
|
+
data.tar.gz: a5147a7a7453d128771951d86a76293cb59d2a60ad9fa6b79613b2ace50a0b40cce24284cfd5daad8b0fa8c6acfb0f122b6e2ad189c13bb82d06c0df048ead22
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
de:
|
2
|
+
ibandit:
|
3
|
+
is_required: 'muss ausgefüllt werden'
|
4
|
+
wrong_length: 'hat die falsche Länge (muss genau %{expected} Zeichen haben)'
|
5
|
+
is_invalid: 'ist nicht gültig'
|
6
|
+
invalid_country_code: "'%{country_code}' ist keine gültige IBAN Länderkennung"
|
7
|
+
invalid_check_digits: "Die Prüfzahlen sind inkorrekt. Erwartet wurde '%{expected_check_digits}', tatsächlich erhalten '%{check_digits}'."
|
8
|
+
invalid_length: "Die Länge stimmt nicht mit der SWIFT Spezifikation überein (erwartet wurden %{expected_length} Zeichen, tatsächlich erhalten %{length})"
|
9
|
+
not_used_in_country: "wird in %{country_code} nicht benutzt"
|
10
|
+
non_alphanumeric_characters: "Nicht-alphanumerische Zeichen gefunden: %{characters}"
|
11
|
+
invalid_format: "Unerwartetes Format für eine %{country_code} IBAN."
|
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -123,6 +123,15 @@ describe Ibandit::IBAN do
|
|
123
123
|
'country code')
|
124
124
|
end
|
125
125
|
end
|
126
|
+
|
127
|
+
context 'locale de', locale: :de do
|
128
|
+
it 'sets errors on the IBAN' do
|
129
|
+
iban.valid_country_code?
|
130
|
+
expect(iban.errors).
|
131
|
+
to include(country_code: "'AA' ist keine gültige IBAN " \
|
132
|
+
'Länderkennung')
|
133
|
+
end
|
134
|
+
end
|
126
135
|
end
|
127
136
|
end
|
128
137
|
|
@@ -161,6 +170,16 @@ describe Ibandit::IBAN do
|
|
161
170
|
"attendu, '12' reçu.")
|
162
171
|
end
|
163
172
|
end
|
173
|
+
|
174
|
+
context 'locale de', locale: :de do
|
175
|
+
it 'sets errors on the IBAN' do
|
176
|
+
iban.valid_check_digits?
|
177
|
+
expect(iban.errors).
|
178
|
+
to include(check_digits: 'Die Prüfzahlen sind inkorrekt. ' \
|
179
|
+
"Erwartet wurde '82', tatsächlich " \
|
180
|
+
"erhalten '12'.")
|
181
|
+
end
|
182
|
+
end
|
164
183
|
end
|
165
184
|
|
166
185
|
context 'with invalid characters' do
|
@@ -213,6 +232,16 @@ describe Ibandit::IBAN do
|
|
213
232
|
'attendus, 20 reçus)')
|
214
233
|
end
|
215
234
|
end
|
235
|
+
|
236
|
+
context 'locale de', locale: :de do
|
237
|
+
it 'sets errors on the IBAN' do
|
238
|
+
iban.valid_length?
|
239
|
+
expect(iban.errors).
|
240
|
+
to include(length: 'Die Länge stimmt nicht mit der SWIFT ' \
|
241
|
+
'Spezifikation überein (erwartet wurden 22 ' \
|
242
|
+
'Zeichen, tatsächlich erhalten 20)')
|
243
|
+
end
|
244
|
+
end
|
216
245
|
end
|
217
246
|
|
218
247
|
context 'with an invalid country_code' do
|
@@ -254,6 +283,15 @@ describe Ibandit::IBAN do
|
|
254
283
|
'caractères)')
|
255
284
|
end
|
256
285
|
end
|
286
|
+
|
287
|
+
context 'locale de', locale: :de do
|
288
|
+
it 'sets errors on the IBAN' do
|
289
|
+
iban.valid_bank_code_length?
|
290
|
+
expect(iban.errors).
|
291
|
+
to include(bank_code: 'hat die falsche Länge (muss genau 4 ' \
|
292
|
+
'Zeichen haben)')
|
293
|
+
end
|
294
|
+
end
|
257
295
|
end
|
258
296
|
|
259
297
|
context 'with an invalid country_code' do
|
@@ -295,6 +333,15 @@ describe Ibandit::IBAN do
|
|
295
333
|
'caractères)')
|
296
334
|
end
|
297
335
|
end
|
336
|
+
|
337
|
+
context 'locale de', locale: :de do
|
338
|
+
it 'sets errors on the IBAN' do
|
339
|
+
iban.valid_branch_code_length?
|
340
|
+
expect(iban.errors).
|
341
|
+
to include(branch_code: 'hat die falsche Länge (muss genau 6 ' \
|
342
|
+
'Zeichen haben)')
|
343
|
+
end
|
344
|
+
end
|
298
345
|
end
|
299
346
|
|
300
347
|
context 'without a branch code' do
|
@@ -314,6 +361,13 @@ describe Ibandit::IBAN do
|
|
314
361
|
expect(iban.errors).to include(branch_code: 'est requis')
|
315
362
|
end
|
316
363
|
end
|
364
|
+
|
365
|
+
context 'locale de', locale: :de do
|
366
|
+
it 'sets errors on the IBAN' do
|
367
|
+
iban.valid_branch_code_length?
|
368
|
+
expect(iban.errors).to include(branch_code: 'muss ausgefüllt werden')
|
369
|
+
end
|
370
|
+
end
|
317
371
|
end
|
318
372
|
|
319
373
|
context 'with an invalid country_code' do
|
@@ -355,6 +409,15 @@ describe Ibandit::IBAN do
|
|
355
409
|
'avoir 8 caractères)')
|
356
410
|
end
|
357
411
|
end
|
412
|
+
|
413
|
+
context 'locale de', locale: :de do
|
414
|
+
it 'sets errors on the IBAN' do
|
415
|
+
iban.valid_account_number_length?
|
416
|
+
expect(iban.errors).
|
417
|
+
to include(account_number: 'hat die falsche Länge (muss genau ' \
|
418
|
+
'8 Zeichen haben)')
|
419
|
+
end
|
420
|
+
end
|
358
421
|
end
|
359
422
|
|
360
423
|
context 'with an invalid country_code' do
|
@@ -396,6 +459,14 @@ describe Ibandit::IBAN do
|
|
396
459
|
': -')
|
397
460
|
end
|
398
461
|
end
|
462
|
+
|
463
|
+
context 'locale de', locale: :de do
|
464
|
+
it 'sets errors on the IBAN' do
|
465
|
+
iban.valid_characters?
|
466
|
+
expect(iban.errors).
|
467
|
+
to include(characters: 'Nicht-alphanumerische Zeichen gefunden: -')
|
468
|
+
end
|
469
|
+
end
|
399
470
|
end
|
400
471
|
end
|
401
472
|
|
@@ -426,6 +497,14 @@ describe Ibandit::IBAN do
|
|
426
497
|
to include(format: "Format inconnu pour l'IBAN GB.")
|
427
498
|
end
|
428
499
|
end
|
500
|
+
|
501
|
+
context 'locale de', locale: :de do
|
502
|
+
it 'sets errors on the IBAN' do
|
503
|
+
iban.valid_format?
|
504
|
+
expect(iban.errors).
|
505
|
+
to include(format: 'Unerwartetes Format für eine GB IBAN.')
|
506
|
+
end
|
507
|
+
end
|
429
508
|
end
|
430
509
|
|
431
510
|
context 'with an invalid country_code' do
|
@@ -467,6 +546,13 @@ describe Ibandit::IBAN do
|
|
467
546
|
expect(iban.errors).to include(bank_code: 'est invalide')
|
468
547
|
end
|
469
548
|
end
|
549
|
+
|
550
|
+
context 'locale de', locale: :de do
|
551
|
+
it 'sets errors on the IBAN' do
|
552
|
+
iban.valid_bank_code_format?
|
553
|
+
expect(iban.errors).to include(bank_code: 'ist nicht gültig')
|
554
|
+
end
|
555
|
+
end
|
470
556
|
end
|
471
557
|
|
472
558
|
context 'with an invalid country code' do
|
@@ -517,6 +603,13 @@ describe Ibandit::IBAN do
|
|
517
603
|
expect(iban.errors).to include(branch_code: 'est invalide')
|
518
604
|
end
|
519
605
|
end
|
606
|
+
|
607
|
+
context 'locale de', locale: :de do
|
608
|
+
it 'sets errors on the IBAN' do
|
609
|
+
iban.valid_branch_code_format?
|
610
|
+
expect(iban.errors).to include(branch_code: 'ist nicht gültig')
|
611
|
+
end
|
612
|
+
end
|
520
613
|
end
|
521
614
|
|
522
615
|
context 'with an invalid country code' do
|
@@ -566,6 +659,13 @@ describe Ibandit::IBAN do
|
|
566
659
|
expect(iban.errors).to include(account_number: 'est invalide')
|
567
660
|
end
|
568
661
|
end
|
662
|
+
|
663
|
+
context 'locale de', locale: :de do
|
664
|
+
it 'sets errors on the IBAN' do
|
665
|
+
iban.valid_account_number_format?
|
666
|
+
expect(iban.errors).to include(account_number: 'ist nicht gültig')
|
667
|
+
end
|
668
|
+
end
|
569
669
|
end
|
570
670
|
|
571
671
|
context 'with an invalid country code' do
|
@@ -617,6 +717,12 @@ describe Ibandit::IBAN do
|
|
617
717
|
specify { expect(iban.errors).to include(bank_code: 'est invalide') }
|
618
718
|
end
|
619
719
|
|
720
|
+
context 'locale de', locale: :de do
|
721
|
+
specify do
|
722
|
+
expect(iban.errors).to include(bank_code: 'ist nicht gültig')
|
723
|
+
end
|
724
|
+
end
|
725
|
+
|
620
726
|
context 'when the bank code is not required' do
|
621
727
|
let(:iban_code) { 'GB60BARC20000055779911' }
|
622
728
|
before { Ibandit.bic_finder = double(call: 'BARCGB22XXX') }
|
@@ -635,6 +741,12 @@ describe Ibandit::IBAN do
|
|
635
741
|
expect(iban.errors).to include(branch_code: 'est invalide')
|
636
742
|
end
|
637
743
|
end
|
744
|
+
|
745
|
+
context 'locale de', locale: :de do
|
746
|
+
specify do
|
747
|
+
expect(iban.errors).to include(branch_code: 'ist nicht gültig')
|
748
|
+
end
|
749
|
+
end
|
638
750
|
end
|
639
751
|
end
|
640
752
|
|
@@ -654,6 +766,12 @@ describe Ibandit::IBAN do
|
|
654
766
|
expect(iban.errors).to include(account_number: 'est invalide')
|
655
767
|
end
|
656
768
|
end
|
769
|
+
|
770
|
+
context 'locale de', locale: :de do
|
771
|
+
specify do
|
772
|
+
expect(iban.errors).to include(account_number: 'ist nicht gültig')
|
773
|
+
end
|
774
|
+
end
|
657
775
|
end
|
658
776
|
end
|
659
777
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibandit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grey Baker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- TODO.md
|
115
115
|
- bin/build_german_iban_rules.rb
|
116
116
|
- bin/build_structure_file.rb
|
117
|
+
- config/locales/de.yml
|
117
118
|
- config/locales/en.yml
|
118
119
|
- config/locales/fr.yml
|
119
120
|
- data/german_iban_rules.yml
|