ibandit 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44ae537cad4cd046f626011aed09d607eecdf1db
4
- data.tar.gz: ba08d25b835cab339e303d060e2538f397e3caf9
3
+ metadata.gz: 47a05d641f6a46bee697a2f85ae26e034f16febd
4
+ data.tar.gz: 04cc3b63315c5bfbee7c2782afc917b506b79b25
5
5
  SHA512:
6
- metadata.gz: d097224eae7040a20501c70d5d6dab86e8de5df4ad4158aa96d7403a652b5a9713f162ec772220fac7f10accbf8d7570d6c1be0a74b91c9206115c2af9439286
7
- data.tar.gz: a5147a7a7453d128771951d86a76293cb59d2a60ad9fa6b79613b2ace50a0b40cce24284cfd5daad8b0fa8c6acfb0f122b6e2ad189c13bb82d06c0df048ead22
6
+ metadata.gz: 1a8eaecc5d0b069e49573f37d9b58426a5c5f6579992a367d146ee8f25743a60df8632f49d227837258b18781e5b664f9da7ffd673cd3fb6f04fb3f888260433
7
+ data.tar.gz: a56415b3d8cb258e7bef9f5a3b6c83a0c3baeb991a601913ccba290d5b7c50f46db9edc81f370c33a9433b45580cb06484a3eed4ab6be4264c97d234bcf07879
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.8 - April 8, 2015
2
+
3
+ - Add Portuguese translation by [@nlopes](https://github.com/nlopes)
4
+
1
5
  ## 0.3.7 - April 7, 2015
2
6
 
3
7
  - Add German translation by [@georg911](https://github.com/georg911)
@@ -0,0 +1,13 @@
1
+ pt:
2
+ ibandit:
3
+ invalid_country_code: "'%{country_code}' não é um código IBAN válido para país segundo o ISO 3166-1"
4
+ invalid_check_digits: "Dígitos de controlo falharam a verificação. Esperados '%{expected_check_digits}', recebidos '%{check_digits}'."
5
+ invalid_length: "O tamanho não está segundo a especificação SWIFT (esperados %{expected_length} caracteres, recebidos %{length})"
6
+ is_required: "é requerido"
7
+ wrong_length: "tem o tamanho errado (deve ter %{expected} caracteres)"
8
+ not_used_in_country: "não é usado em %{country_code}"
9
+ non_alphanumeric_characters: "Caracteres não alfanuméricos encontrados: %{characters}"
10
+ invalid_format: "Formato errado para um IBAN %{country_code}."
11
+ is_invalid: "é inválido"
12
+
13
+
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.3.7'.freeze
2
+ VERSION = '0.3.8'.freeze
3
3
  end
@@ -132,6 +132,15 @@ describe Ibandit::IBAN do
132
132
  'Länderkennung')
133
133
  end
134
134
  end
135
+
136
+ context 'locale pt', locale: :pt do
137
+ it 'sets errors on the IBAN' do
138
+ iban.valid_country_code?
139
+ expect(iban.errors).
140
+ to include(country_code: "'AA' não é um código IBAN válido para " \
141
+ 'país segundo o ISO 3166-1')
142
+ end
143
+ end
135
144
  end
136
145
  end
137
146
 
@@ -180,6 +189,16 @@ describe Ibandit::IBAN do
180
189
  "erhalten '12'.")
181
190
  end
182
191
  end
192
+
193
+ context 'locale pt', locale: :pt do
194
+ it 'sets errors on the IBAN' do
195
+ iban.valid_check_digits?
196
+ expect(iban.errors).
197
+ to include(check_digits: 'Dígitos de controlo falharam a ' \
198
+ "verificação. Esperados '82', " \
199
+ "recebidos '12'.")
200
+ end
201
+ end
183
202
  end
184
203
 
185
204
  context 'with invalid characters' do
@@ -242,6 +261,15 @@ describe Ibandit::IBAN do
242
261
  'Zeichen, tatsächlich erhalten 20)')
243
262
  end
244
263
  end
264
+
265
+ context 'locale pt', locale: :pt do
266
+ it 'sets errors on the IBAN' do
267
+ iban.valid_length?
268
+ expect(iban.errors).
269
+ to include(length: 'O tamanho não está segundo a especificação ' \
270
+ 'SWIFT (esperados 22 caracteres, recebidos 20)')
271
+ end
272
+ end
245
273
  end
246
274
 
247
275
  context 'with an invalid country_code' do
@@ -292,6 +320,15 @@ describe Ibandit::IBAN do
292
320
  'Zeichen haben)')
293
321
  end
294
322
  end
323
+
324
+ context 'locale pt', locale: :pt do
325
+ it 'sets errors on the IBAN' do
326
+ iban.valid_bank_code_length?
327
+ expect(iban.errors).
328
+ to include(bank_code: 'tem o tamanho errado (deve ter 4 ' \
329
+ 'caracteres)')
330
+ end
331
+ end
295
332
  end
296
333
 
297
334
  context 'with an invalid country_code' do
@@ -342,6 +379,15 @@ describe Ibandit::IBAN do
342
379
  'Zeichen haben)')
343
380
  end
344
381
  end
382
+
383
+ context 'locale pt', locale: :pt do
384
+ it 'sets errors on the IBAN' do
385
+ iban.valid_branch_code_length?
386
+ expect(iban.errors).
387
+ to include(branch_code: 'tem o tamanho errado (deve ter 6 ' \
388
+ 'caracteres)')
389
+ end
390
+ end
345
391
  end
346
392
 
347
393
  context 'without a branch code' do
@@ -368,6 +414,13 @@ describe Ibandit::IBAN do
368
414
  expect(iban.errors).to include(branch_code: 'muss ausgefüllt werden')
369
415
  end
370
416
  end
417
+
418
+ context 'locale pt', locale: :pt do
419
+ it 'sets errors on the IBAN' do
420
+ iban.valid_branch_code_length?
421
+ expect(iban.errors).to include(branch_code: 'é requerido')
422
+ end
423
+ end
371
424
  end
372
425
 
373
426
  context 'with an invalid country_code' do
@@ -418,6 +471,15 @@ describe Ibandit::IBAN do
418
471
  '8 Zeichen haben)')
419
472
  end
420
473
  end
474
+
475
+ context 'locale pt', locale: :pt do
476
+ it 'sets errors on the IBAN' do
477
+ iban.valid_account_number_length?
478
+ expect(iban.errors).
479
+ to include(account_number: 'tem o tamanho errado (deve ter 8 ' \
480
+ 'caracteres)')
481
+ end
482
+ end
421
483
  end
422
484
 
423
485
  context 'with an invalid country_code' do
@@ -467,6 +529,15 @@ describe Ibandit::IBAN do
467
529
  to include(characters: 'Nicht-alphanumerische Zeichen gefunden: -')
468
530
  end
469
531
  end
532
+
533
+ context 'locale pt', locale: :pt do
534
+ it 'sets errors on the IBAN' do
535
+ iban.valid_characters?
536
+ expect(iban.errors).
537
+ to include(characters: 'Caracteres não alfanuméricos ' \
538
+ 'encontrados: -')
539
+ end
540
+ end
470
541
  end
471
542
  end
472
543
 
@@ -505,6 +576,14 @@ describe Ibandit::IBAN do
505
576
  to include(format: 'Unerwartetes Format für eine GB IBAN.')
506
577
  end
507
578
  end
579
+
580
+ context 'locale pt', locale: :pt do
581
+ it 'sets errors on the IBAN' do
582
+ iban.valid_format?
583
+ expect(iban.errors).
584
+ to include(format: 'Formato errado para um IBAN GB.')
585
+ end
586
+ end
508
587
  end
509
588
 
510
589
  context 'with an invalid country_code' do
@@ -553,6 +632,13 @@ describe Ibandit::IBAN do
553
632
  expect(iban.errors).to include(bank_code: 'ist nicht gültig')
554
633
  end
555
634
  end
635
+
636
+ context 'locale pt', locale: :pt do
637
+ it 'sets errors on the IBAN' do
638
+ iban.valid_bank_code_format?
639
+ expect(iban.errors).to include(bank_code: 'é inválido')
640
+ end
641
+ end
556
642
  end
557
643
 
558
644
  context 'with an invalid country code' do
@@ -610,6 +696,13 @@ describe Ibandit::IBAN do
610
696
  expect(iban.errors).to include(branch_code: 'ist nicht gültig')
611
697
  end
612
698
  end
699
+
700
+ context 'locale pt', locale: :pt do
701
+ it 'sets errors on the IBAN' do
702
+ iban.valid_branch_code_format?
703
+ expect(iban.errors).to include(branch_code: 'é inválido')
704
+ end
705
+ end
613
706
  end
614
707
 
615
708
  context 'with an invalid country code' do
@@ -666,6 +759,13 @@ describe Ibandit::IBAN do
666
759
  expect(iban.errors).to include(account_number: 'ist nicht gültig')
667
760
  end
668
761
  end
762
+
763
+ context 'locale pt', locale: :pt do
764
+ it 'sets errors on the IBAN' do
765
+ iban.valid_account_number_format?
766
+ expect(iban.errors).to include(account_number: 'é inválido')
767
+ end
768
+ end
669
769
  end
670
770
 
671
771
  context 'with an invalid country code' do
@@ -723,6 +823,10 @@ describe Ibandit::IBAN do
723
823
  end
724
824
  end
725
825
 
826
+ context 'locale pt', locale: :pt do
827
+ specify { expect(iban.errors).to include(bank_code: 'é inválido') }
828
+ end
829
+
726
830
  context 'when the bank code is not required' do
727
831
  let(:iban_code) { 'GB60BARC20000055779911' }
728
832
  before { Ibandit.bic_finder = double(call: 'BARCGB22XXX') }
@@ -747,6 +851,12 @@ describe Ibandit::IBAN do
747
851
  expect(iban.errors).to include(branch_code: 'ist nicht gültig')
748
852
  end
749
853
  end
854
+
855
+ context 'locale pt', locale: :pt do
856
+ specify do
857
+ expect(iban.errors).to include(branch_code: 'é inválido')
858
+ end
859
+ end
750
860
  end
751
861
  end
752
862
 
@@ -772,6 +882,12 @@ describe Ibandit::IBAN do
772
882
  expect(iban.errors).to include(account_number: 'ist nicht gültig')
773
883
  end
774
884
  end
885
+
886
+ context 'locale pt', locale: :pt do
887
+ specify do
888
+ expect(iban.errors).to include(account_number: 'é inválido')
889
+ end
890
+ end
775
891
  end
776
892
  end
777
893
  end
data/spec/spec_helper.rb CHANGED
@@ -22,3 +22,7 @@ end
22
22
  RSpec.shared_context 'locale de', locale: :de do
23
23
  around { |example| I18n.with_locale(:de) { example.run } }
24
24
  end
25
+
26
+ RSpec.shared_context 'locale pt', locale: :pt do
27
+ around { |example| I18n.with_locale(:pt) { example.run } }
28
+ end
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.7
4
+ version: 0.3.8
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-04-07 00:00:00.000000000 Z
11
+ date: 2015-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -117,6 +117,7 @@ files:
117
117
  - config/locales/de.yml
118
118
  - config/locales/en.yml
119
119
  - config/locales/fr.yml
120
+ - config/locales/pt.yml
120
121
  - data/german_iban_rules.yml
121
122
  - data/raw/BLZ2.txt
122
123
  - data/raw/IBANSTRUCTURE.xml