ibandit 1.25.0 → 1.26.1

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
@@ -56,12 +56,14 @@ module Ibandit
56
56
  end
57
57
 
58
58
  def account_number
59
+ return nil if @account_number.nil?
59
60
  return @account_number unless country_code == "NZ"
60
61
 
61
62
  @account_number[0..6]
62
63
  end
63
64
 
64
65
  def account_number_suffix
66
+ return nil if @account_number.nil?
65
67
  return nil unless country_code == "NZ"
66
68
 
67
69
  @account_number[7..]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ibandit
4
- VERSION = "1.25.0"
4
+ VERSION = "1.26.1"
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
@@ -799,6 +799,24 @@ describe Ibandit::IBAN do
799
799
  its(:to_s) { is_expected.to eq("") }
800
800
  end
801
801
 
802
+ context "with a nil account number" do
803
+ let(:account_number) { nil }
804
+
805
+ its(:country_code) { is_expected.to eq("NZ") }
806
+ its(:bank_code) { is_expected.to eq("11") }
807
+ its(:branch_code) { is_expected.to eq("2222") }
808
+ its(:account_number) { is_expected.to eq(nil) }
809
+ its(:account_number_suffix) { is_expected.to eq(nil) }
810
+ its(:swift_bank_code) { is_expected.to eq("11") }
811
+ its(:swift_branch_code) { is_expected.to eq("2222") }
812
+ its(:swift_account_number) { is_expected.to eq(nil) }
813
+ its(:swift_national_id) { is_expected.to eq("112222") }
814
+ its(:iban) { is_expected.to be_nil }
815
+ its(:pseudo_iban) { is_expected.to eq(nil) }
816
+ its(:valid?) { is_expected.to eq(false) }
817
+ its(:to_s) { is_expected.to eq("") }
818
+ end
819
+
802
820
  context "with bank and branch code embedded in account_number field" do
803
821
  let(:arg) do
804
822
  {
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.25.0
4
+ version: 1.26.1
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-07 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: i18n