ibandit 1.24.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ibandit/iban.rb CHANGED
@@ -128,6 +128,7 @@ module Ibandit
128
128
  end
129
129
 
130
130
  def valid_check_digits?
131
+ return true if source == :pseudo_iban && check_digits == Constants::PSEUDO_IBAN_CHECK_DIGITS
131
132
  return unless decomposable? && valid_characters?
132
133
 
133
134
  expected_check_digits = CheckDigit.iban(country_code, bban)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.24.0"
4
+ VERSION = "1.26.0"
5
5
  end
@@ -59,7 +59,7 @@ describe Ibandit::GermanDetailsConverter do
59
59
  end
60
60
 
61
61
  describe "integration tests" do
62
- include_examples "json based fixture", "germany_integration_test_cases" do
62
+ it_behaves_like "json based fixture", "germany_integration_test_cases" do
63
63
  let(:test_subject) do
64
64
  described_class.
65
65
  convert(bank_code: bank_code, account_number: account_number)
@@ -68,7 +68,7 @@ describe Ibandit::GermanDetailsConverter do
68
68
  end
69
69
 
70
70
  describe "unit tests" do
71
- include_examples "json based fixture", "germany_unit_test_cases" do
71
+ it_behaves_like "json based fixture", "germany_unit_test_cases" do
72
72
  let(:test_subject) do
73
73
  klass.new(bank_code, account_number).converted_details
74
74
  end
@@ -183,6 +183,7 @@ describe Ibandit::IBAN do
183
183
  its(:iban) { is_expected.to eq("SE5412000000012810105723") }
184
184
  its(:pseudo_iban) { is_expected.to eq("SEZZX1281XXX0105723") }
185
185
  its(:to_s) { is_expected.to eq("SE5412000000012810105723") }
186
+ its(:valid?) { is_expected.to eq(true) }
186
187
 
187
188
  context "and the clearing code is not part of the IBAN" do
188
189
  context "and the branch code allows for zero-filling of short account numbers" do
@@ -266,9 +267,17 @@ describe Ibandit::IBAN do
266
267
  its(:iban) { is_expected.to eq("SE5412000000012810105723") }
267
268
  its(:pseudo_iban) { is_expected.to eq("SEZZX1281XXX0105723") }
268
269
  its(:to_s) { is_expected.to eq("SE5412000000012810105723") }
270
+ its(:valid?) { is_expected.to eq(true) }
269
271
  end
270
272
 
271
273
  context "when the IBAN was created from a Swedish IBAN" do
274
+ context "with check digits that make it look like a pseudo-IBAN" do
275
+ let(:arg) { "SEZZ30000000031231234567" }
276
+
277
+ its(:country_code) { is_expected.to eq("SE") }
278
+ its(:valid?) { is_expected.to eq(false) }
279
+ end
280
+
272
281
  context "where the clearing code is part of the account number" do
273
282
  let(:arg) { "SE4730000000031231234567" }
274
283
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.0
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-18 00:00:00.000000000 Z
10
+ date: 2025-07-01 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: i18n