ibandit 0.4.2 → 0.4.3
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/it.yml +11 -0
- data/lib/ibandit/check_digit.rb +1 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +107 -0
- data/spec/spec_helper.rb +4 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c06efe45861dbe134ba9ae0a6b555fd0461e2a6
|
4
|
+
data.tar.gz: a3fc0e19c68670284337a450e4d5541ab92d5d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b56b6a9fc18b0d933f282649ed2f13800d18f99f1fc4c89fb8f9a72f6857eb688d23371979ebe3dd73ed5b08a62413179a9689129564abb49b106abe3d8dac7
|
7
|
+
data.tar.gz: 5da040cfd010b9a038c435bcaf052e9118ade4f871562e14ab48d3bac3dcad0eee39fbe6849b75357136bc72f39ed66fca40e777e489154362ffc7f347039a24
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
it:
|
2
|
+
ibandit:
|
3
|
+
invalid_country_code: "'%{country_code}' non è un ISO 3166-1 codice IBAN valido"
|
4
|
+
invalid_check_digits: "la cifra di controllo non ha superato il controllo del modulo. Previsto '%{expected_check_digits}', ricevuto '%{check_digits}'."
|
5
|
+
invalid_length: "La lunghezza non corrisponde ai requisiti SWIFT (Previsti %{expected_length} caratteri, ricevuti %{length})"
|
6
|
+
is_required: "è obbligatorio"
|
7
|
+
wrong_length: "è della lunghezza sbagliata (dovrebbe essere di %{expected} caratteri)"
|
8
|
+
not_used_in_country: "non è usato in %{country_code}"
|
9
|
+
non_alphanumeric_characters: "Un carattere non-alfanumerico è stato trovato: %{characters}"
|
10
|
+
invalid_format: "Formato non atteso per un IBAN %{country_code}."
|
11
|
+
is_invalid: "non è valido"
|
data/lib/ibandit/check_digit.rb
CHANGED
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -209,6 +209,16 @@ describe Ibandit::IBAN do
|
|
209
209
|
"esperaba '82', se ha recibido '12'.")
|
210
210
|
end
|
211
211
|
end
|
212
|
+
|
213
|
+
context 'locale it', locale: :it do
|
214
|
+
it 'sets errors on the IBAN' do
|
215
|
+
iban.valid_check_digits?
|
216
|
+
expect(iban.errors).
|
217
|
+
to include(check_digits: 'la cifra di controllo non ha superato ' \
|
218
|
+
"il controllo del modulo. Previsto '82'" \
|
219
|
+
", ricevuto '12'.")
|
220
|
+
end
|
221
|
+
end
|
212
222
|
end
|
213
223
|
|
214
224
|
context 'with invalid characters' do
|
@@ -290,6 +300,15 @@ describe Ibandit::IBAN do
|
|
290
300
|
'símbolos, se ha recibido 20)')
|
291
301
|
end
|
292
302
|
end
|
303
|
+
|
304
|
+
context 'locale it', locale: :it do
|
305
|
+
it 'sets errors on the IBAN' do
|
306
|
+
iban.valid_length?
|
307
|
+
expect(iban.errors).
|
308
|
+
to include(length: 'La lunghezza non corrisponde ai requisiti ' \
|
309
|
+
'SWIFT (Previsti 22 caratteri, ricevuti 20)')
|
310
|
+
end
|
311
|
+
end
|
293
312
|
end
|
294
313
|
|
295
314
|
context 'with an invalid country_code' do
|
@@ -358,6 +377,15 @@ describe Ibandit::IBAN do
|
|
358
377
|
'formarse de 4 símbolos)')
|
359
378
|
end
|
360
379
|
end
|
380
|
+
|
381
|
+
context 'locale it', locale: :it do
|
382
|
+
it 'sets errors on the IBAN' do
|
383
|
+
iban.valid_bank_code_length?
|
384
|
+
expect(iban.errors).
|
385
|
+
to include(bank_code: 'è della lunghezza sbagliata (dovrebbe ' \
|
386
|
+
'essere di 4 caratteri)')
|
387
|
+
end
|
388
|
+
end
|
361
389
|
end
|
362
390
|
|
363
391
|
context 'with an invalid country_code' do
|
@@ -426,6 +454,15 @@ describe Ibandit::IBAN do
|
|
426
454
|
'formarse de 6 símbolos)')
|
427
455
|
end
|
428
456
|
end
|
457
|
+
|
458
|
+
context 'locale it', locale: :it do
|
459
|
+
it 'sets errors on the IBAN' do
|
460
|
+
iban.valid_branch_code_length?
|
461
|
+
expect(iban.errors).
|
462
|
+
to include(branch_code: 'è della lunghezza sbagliata (dovrebbe ' \
|
463
|
+
'essere di 6 caratteri)')
|
464
|
+
end
|
465
|
+
end
|
429
466
|
end
|
430
467
|
|
431
468
|
context 'without a branch code' do
|
@@ -466,6 +503,13 @@ describe Ibandit::IBAN do
|
|
466
503
|
expect(iban.errors).to include(branch_code: 'es obligatorio')
|
467
504
|
end
|
468
505
|
end
|
506
|
+
|
507
|
+
context 'locale it', locale: :it do
|
508
|
+
it 'sets errors on the IBAN' do
|
509
|
+
iban.valid_branch_code_length?
|
510
|
+
expect(iban.errors).to include(branch_code: 'è obbligatorio')
|
511
|
+
end
|
512
|
+
end
|
469
513
|
end
|
470
514
|
|
471
515
|
context 'with an invalid country_code' do
|
@@ -534,6 +578,15 @@ describe Ibandit::IBAN do
|
|
534
578
|
'(debería formarse de 8 símbolos)')
|
535
579
|
end
|
536
580
|
end
|
581
|
+
|
582
|
+
context 'locale it', locale: :it do
|
583
|
+
it 'sets errors on the IBAN' do
|
584
|
+
iban.valid_account_number_length?
|
585
|
+
expect(iban.errors).
|
586
|
+
to include(account_number: 'è della lunghezza sbagliata ' \
|
587
|
+
'(dovrebbe essere di 8 caratteri)')
|
588
|
+
end
|
589
|
+
end
|
537
590
|
end
|
538
591
|
|
539
592
|
context 'with an invalid country_code' do
|
@@ -601,6 +654,15 @@ describe Ibandit::IBAN do
|
|
601
654
|
'alfanuméricos: -')
|
602
655
|
end
|
603
656
|
end
|
657
|
+
|
658
|
+
context 'locale it', locale: :it do
|
659
|
+
it 'sets errors on the IBAN' do
|
660
|
+
iban.valid_characters?
|
661
|
+
expect(iban.errors).
|
662
|
+
to include(characters: 'Un carattere non-alfanumerico è stato ' \
|
663
|
+
'trovato: -')
|
664
|
+
end
|
665
|
+
end
|
604
666
|
end
|
605
667
|
end
|
606
668
|
|
@@ -655,6 +717,14 @@ describe Ibandit::IBAN do
|
|
655
717
|
to include(format: 'Formato inesperado para un IBAN de GB.')
|
656
718
|
end
|
657
719
|
end
|
720
|
+
|
721
|
+
context 'locale it', locale: :it do
|
722
|
+
it 'sets errors on the IBAN' do
|
723
|
+
iban.valid_format?
|
724
|
+
expect(iban.errors).
|
725
|
+
to include(format: 'Formato non atteso per un IBAN GB.')
|
726
|
+
end
|
727
|
+
end
|
658
728
|
end
|
659
729
|
|
660
730
|
context 'with an invalid country_code' do
|
@@ -717,6 +787,13 @@ describe Ibandit::IBAN do
|
|
717
787
|
expect(iban.errors).to include(bank_code: 'es inválido')
|
718
788
|
end
|
719
789
|
end
|
790
|
+
|
791
|
+
context 'locale it', locale: :it do
|
792
|
+
it 'sets errors on the IBAN' do
|
793
|
+
iban.valid_bank_code_format?
|
794
|
+
expect(iban.errors).to include(bank_code: 'non è valido')
|
795
|
+
end
|
796
|
+
end
|
720
797
|
end
|
721
798
|
|
722
799
|
context 'with an invalid country code' do
|
@@ -788,6 +865,13 @@ describe Ibandit::IBAN do
|
|
788
865
|
expect(iban.errors).to include(branch_code: 'es inválido')
|
789
866
|
end
|
790
867
|
end
|
868
|
+
|
869
|
+
context 'locale it', locale: :it do
|
870
|
+
it 'sets errors on the IBAN' do
|
871
|
+
iban.valid_branch_code_format?
|
872
|
+
expect(iban.errors).to include(branch_code: 'non è valido')
|
873
|
+
end
|
874
|
+
end
|
791
875
|
end
|
792
876
|
|
793
877
|
context 'with an invalid country code' do
|
@@ -858,6 +942,13 @@ describe Ibandit::IBAN do
|
|
858
942
|
expect(iban.errors).to include(account_number: 'es inválido')
|
859
943
|
end
|
860
944
|
end
|
945
|
+
|
946
|
+
context 'locale it', locale: :it do
|
947
|
+
it 'sets errors on the IBAN' do
|
948
|
+
iban.valid_account_number_format?
|
949
|
+
expect(iban.errors).to include(account_number: 'non è valido')
|
950
|
+
end
|
951
|
+
end
|
861
952
|
end
|
862
953
|
|
863
954
|
context 'with an invalid country code' do
|
@@ -923,6 +1014,10 @@ describe Ibandit::IBAN do
|
|
923
1014
|
specify { expect(iban.errors).to include(bank_code: 'es inválido') }
|
924
1015
|
end
|
925
1016
|
|
1017
|
+
context 'locale it', locale: :it do
|
1018
|
+
specify { expect(iban.errors).to include(bank_code: 'non è valido') }
|
1019
|
+
end
|
1020
|
+
|
926
1021
|
context 'when the bank code is not required' do
|
927
1022
|
let(:iban_code) { 'GB60BARC20000055779911' }
|
928
1023
|
before { Ibandit.bic_finder = double(call: 'BARCGB22XXX') }
|
@@ -959,6 +1054,12 @@ describe Ibandit::IBAN do
|
|
959
1054
|
expect(iban.errors).to include(branch_code: 'es inválido')
|
960
1055
|
end
|
961
1056
|
end
|
1057
|
+
|
1058
|
+
context 'locale it', locale: :it do
|
1059
|
+
specify do
|
1060
|
+
expect(iban.errors).to include(branch_code: 'non è valido')
|
1061
|
+
end
|
1062
|
+
end
|
962
1063
|
end
|
963
1064
|
end
|
964
1065
|
|
@@ -996,6 +1097,12 @@ describe Ibandit::IBAN do
|
|
996
1097
|
expect(iban.errors).to include(account_number: 'es inválido')
|
997
1098
|
end
|
998
1099
|
end
|
1100
|
+
|
1101
|
+
context 'locale it', locale: :it do
|
1102
|
+
specify do
|
1103
|
+
expect(iban.errors).to include(account_number: 'non è valido')
|
1104
|
+
end
|
1105
|
+
end
|
999
1106
|
end
|
1000
1107
|
end
|
1001
1108
|
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.4.
|
4
|
+
version: 0.4.3
|
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-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- config/locales/en.yml
|
119
119
|
- config/locales/es.yml
|
120
120
|
- config/locales/fr.yml
|
121
|
+
- config/locales/it.yml
|
121
122
|
- config/locales/pt.yml
|
122
123
|
- data/german_iban_rules.yml
|
123
124
|
- data/raw/BLZ2.txt
|
@@ -164,9 +165,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
version: '0'
|
165
166
|
requirements: []
|
166
167
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.2.2
|
168
169
|
signing_key:
|
169
170
|
specification_version: 4
|
170
171
|
summary: Convert national banking details into IBANs, and vice-versa.
|
171
172
|
test_files: []
|
172
|
-
has_rdoc:
|