Skip to content

Commit

Permalink
Autocorrect gc_ruboconfig v2.29
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSouthan committed Oct 20, 2021
1 parent 553bedc commit 1ee0cb6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions lib/ibandit/german_details_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,15 @@ def padded_account_number_for_validity
when "13"
if unpadded_account_number.size.between?(6, 7)
unpadded_account_number + "00"
else @account_number
else
@account_number
end
when "76"
case unpadded_account_number.size
when 7..8
if Check76.new(@account_number).valid? then @account_number
else unpadded_account_number + "00"
else
unpadded_account_number + "00"
end
when 5..6 then unpadded_account_number + "00"
else @account_number
Expand Down
3 changes: 2 additions & 1 deletion lib/ibandit/local_details_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def self.required_fields(country_code)
%i[account_number]
when "GB", "IE", "MT"
if Ibandit.bic_finder.nil? then %i[bank_code branch_code account_number]
else %i[branch_code account_number]
else
%i[branch_code account_number]
end
when "AU"
%i[branch_code account_number]
Expand Down
4 changes: 2 additions & 2 deletions spec/ibandit/german_details_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

convertor.fetch("valid", []).each do |tuple|
context "bank code: #{tuple['bank_code']} account number " \
"#{tuple['account_number']}" do
"#{tuple['account_number']}" do
let(:bank_code) do
tuple["bank_code"]
end
Expand All @@ -44,7 +44,7 @@

convertor.fetch("invalid", []).each do |tuple|
context "bank code: #{tuple['bank_code']} account number " \
"#{tuple['account_number']}" do
"#{tuple['account_number']}" do
let(:bank_code) { tuple["bank_code"] || "00000000" }
let(:account_number) { tuple["account_number"] }

Expand Down
4 changes: 2 additions & 2 deletions spec/ibandit/iban_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@
iban.valid_length?
expect(iban.errors).
to include(length: "Length doesn't match SWIFT specification " \
"(expected 22 characters, received 20)")
"(expected 22 characters, received 20)")
end
end

Expand Down Expand Up @@ -1313,7 +1313,7 @@
iban.valid_branch_code_length?
expect(iban.errors).
to include(branch_code: "is the wrong length (should be 6 " \
"characters)")
"characters)")
end
end

Expand Down

0 comments on commit 1ee0cb6

Please sign in to comment.