ibandit 1.19.0 → 1.20.0
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/data/raw/pseudo_ibans.yml +1 -1
- data/data/structures.yml +1 -1
- data/lib/ibandit/version.rb +1 -1
- data/spec/ibandit/iban_spec.rb +46 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c3c4654f26735c5412bd2cf3f02c1c5802d1fb2c6c9f775f1472ea0660cc0c3
|
4
|
+
data.tar.gz: d67a80fea5521e0eac1f1486aefaf584b886ebf846a5d05e3bce8ec6fee21182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c092c285a2923177c42b7deb1e305e9a2b4b1625d642da44a1bca3adac3667276216f187e947fe3f90009ec4f1b190898cf12236dac52e202ba8df61e99fe45
|
7
|
+
data.tar.gz: f1fcb038c96b3ba56fe53fe92688b2c19e25a9dfcbdc423d387fbceca835afa4e78337bf87ec3f9dee71d5bd5880837ac4f0728a4f67a45a7a2de0135aa230a7
|
data/CHANGELOG.md
CHANGED
data/data/raw/pseudo_ibans.yml
CHANGED
data/data/structures.yml
CHANGED
@@ -1500,7 +1500,7 @@ CA:
|
|
1500
1500
|
end: 12
|
1501
1501
|
excl: false
|
1502
1502
|
:bank_code_format: "\\d{4}"
|
1503
|
-
:branch_code_format:
|
1503
|
+
:branch_code_format: 0{0,4}[1-9][0-9]{0,4}
|
1504
1504
|
:account_number_format: "(?!0+\\z)\\d{7,12}"
|
1505
1505
|
:national_id_length: 9
|
1506
1506
|
:pseudo_iban_bank_code_length: 4
|
data/lib/ibandit/version.rb
CHANGED
data/spec/ibandit/iban_spec.rb
CHANGED
@@ -422,10 +422,55 @@ describe Ibandit::IBAN do
|
|
422
422
|
{
|
423
423
|
country_code: "CA",
|
424
424
|
bank_code: bank_code,
|
425
|
-
branch_code:
|
425
|
+
branch_code: branch_code,
|
426
426
|
account_number: account_number,
|
427
427
|
}
|
428
428
|
end
|
429
|
+
let(:branch_code) { "00063" }
|
430
|
+
|
431
|
+
context "and a 5 digit branch code" do
|
432
|
+
let(:account_number) { "0123456" }
|
433
|
+
let(:bank_code) { "036" }
|
434
|
+
let(:branch_code) { "00063" }
|
435
|
+
|
436
|
+
its(:country_code) { is_expected.to eq("CA") }
|
437
|
+
its(:bank_code) { is_expected.to eq("0036") }
|
438
|
+
its(:branch_code) { is_expected.to eq("00063") }
|
439
|
+
its(:account_number) { is_expected.to eq("0123456") }
|
440
|
+
its(:swift_bank_code) { is_expected.to eq("0036") }
|
441
|
+
its(:swift_branch_code) { is_expected.to eq("00063") }
|
442
|
+
its(:swift_account_number) { is_expected.to eq("0123456") }
|
443
|
+
its(:swift_national_id) { is_expected.to eq("003600063") }
|
444
|
+
its(:pseudo_iban) { is_expected.to eq("CAZZ003600063_____0123456") }
|
445
|
+
|
446
|
+
its(:iban) { is_expected.to be_nil }
|
447
|
+
its(:valid?) { is_expected.to eq(true) }
|
448
|
+
its(:to_s) { is_expected.to eq("") }
|
449
|
+
end
|
450
|
+
|
451
|
+
context "for an all zero transit number" do
|
452
|
+
let(:account_number) { "0123456" }
|
453
|
+
let(:bank_code) { "036" }
|
454
|
+
let(:branch_code) { "00000" }
|
455
|
+
|
456
|
+
it "is invalid and has the correct errors" do
|
457
|
+
expect(subject.valid?).to eq(false)
|
458
|
+
expect(subject.errors).
|
459
|
+
to eq(branch_code: "format is invalid")
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
context "and a 4 digit branch code" do
|
464
|
+
let(:account_number) { "0123456" }
|
465
|
+
let(:bank_code) { "036" }
|
466
|
+
let(:branch_code) { "0063" }
|
467
|
+
|
468
|
+
it "is invalid and has the correct errors" do
|
469
|
+
expect(subject.valid?).to eq(false)
|
470
|
+
expect(subject.errors).
|
471
|
+
to eq(branch_code: "is the wrong length (should be 5 characters)")
|
472
|
+
end
|
473
|
+
end
|
429
474
|
|
430
475
|
context "and a 3 digit bank code" do
|
431
476
|
let(:account_number) { "0123456" }
|
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: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gc_ruboconfig
|