ibandit 0.11.27 → 0.11.28

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: 0ef65b4d6eedd45de97dbe15a3b2b3996df05e1c
4
- data.tar.gz: 9e886c94b5513ad76d1d3941f1924db6a011608b
3
+ metadata.gz: 31afcc0a061c33a69c2fdf4dc857603ebb91fd7c
4
+ data.tar.gz: 7f692e0706dc2410613e2e246349f95d9c6f938e
5
5
  SHA512:
6
- metadata.gz: 7b292f452af4977a2799591335975db4cec051ad0a8ce2c686eb89de0e8439476855885ed820f021508fca1f127b0622b098320855bc71e8e957e9f099049b8f
7
- data.tar.gz: d01ef104eb0fad531e3b79dbf1973e9cfc94b786de4403915bbb95ba59060ef7f4d20e2719330f44aef9dc2b70b6f0456269342859592720f362ff0a1f3c6032
6
+ metadata.gz: 3f41f600cbd7a54a809ebdb8d9f4b3976aa23cdace895d03f4184585ebfe615bbfd9c12920df48d438e1d0ad8c15e52ba434e1d8a3803ca588e71e573ae8ae01
7
+ data.tar.gz: 0d269f41269d38e134b54e83a5c559fd75e5fabbd0d86fd8b461cb6f7eab7418fbe7a2af2f662b3c0dc30f83a293c312966f9e52529761557791bbc495a3e316
@@ -1,3 +1,7 @@
1
+ ## 0.11.28 - March 21, 2019
2
+
3
+ - Handle bad input more gracefully (`bank_code` being nil)
4
+
1
5
  ## 0.11.27 - February 22, 2019
2
6
 
3
7
  - Update US account number format validation to allow digits-only
@@ -386,6 +386,7 @@ module Ibandit
386
386
 
387
387
  # rubocop:disable Metrics/AbcSize
388
388
  def bank_code_passes_checksum_test?
389
+ return false unless swift_bank_code
389
390
  return false if swift_bank_code.length != 9
390
391
 
391
392
  code_digits = swift_bank_code.chars.map(&:to_i)
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = "0.11.27".freeze
2
+ VERSION = "0.11.28".freeze
3
3
  end
@@ -683,6 +683,18 @@ describe Ibandit::IBAN do
683
683
  its(:to_s) { is_expected.to eq("") }
684
684
  end
685
685
 
686
+ context "and bank code that is nil" do
687
+ let(:bank_code) { nil }
688
+ let(:account_number) { "01234567890123456" }
689
+
690
+ its(:iban) { is_expected.to be_nil }
691
+
692
+ it "returns an error on bank_code attribute" do
693
+ expect(subject.valid?).to eq(false)
694
+ expect(subject.errors).to eq(bank_code: "is required")
695
+ end
696
+ end
697
+
686
698
  context "and a 17 digit account number" do
687
699
  let(:account_number) { "01234567890123456" }
688
700
  let(:bank_code) { "965498456" }
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.11.27
4
+ version: 0.11.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-22 00:00:00.000000000 Z
11
+ date: 2019-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri