Skip to content

Commit

Permalink
Update rules.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
prokopsimek committed Oct 31, 2016
1 parent f3a7f12 commit ec9b917
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
20 changes: 20 additions & 0 deletions lib/iban-tools/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
length: 21
bban_pattern: '\d{5}[A-Z0-9]{12}'

'CR':
# Costa Rica
length: 21
bban_pattern: '\d[0-9]{2}[0-9]{3}[0-9]{14}'

'CY':
# Cyprus
length: 28
Expand Down Expand Up @@ -130,6 +135,11 @@
length: 27
bban_pattern: '\d{7}[A-Z0-9]{16}'

'GT':
# Guatemala
length: 28
bban_pattern: '\d[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}'

'HR':
# Croatia
length: 21
Expand Down Expand Up @@ -305,6 +315,11 @@
length: 27
bban_pattern: '[A-Z]\d{10}[A-Z0-9]{12}'

'TL':
# Timor-Leste
length: 23
bban_pattern: '\d[0-9]{2}[0-9]{3}[0-9]{14}[0-9]{2}'

'TN':
# Tunisia
length: 24
Expand All @@ -324,3 +339,8 @@
# Virgin Islands
length: 24
bban_pattern: '[A-Z0-9]{4}\d{16}'

'XK':
# Kosovo, Republic of
length: 20
bban_pattern: '\d[0-9]{2}[0-9]{4}[A-Z0-9]{12}'
6 changes: 5 additions & 1 deletion spec/iban-tools/iban_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ module IBANTools
"BH67BMAG00001299123456",
"BR9700360305000010009795493P1",
"CH9300762011623852957",
"CR0515202001026284066",
"CY17002001280000001200527600",
"CZ6508000000192000145399",
"DE89370400440532013000",
Expand All @@ -119,6 +120,7 @@ module IBANTools
"GI75NWBK000000007099453",
"GL4330003330229543",
"GR1601101250000000012300695",
"GT82TRAJ01020000001210029690",
"HR1210010051863000160",
"HU42117730161111101800000000",
"IE29AIBK93115212345678",
Expand Down Expand Up @@ -153,9 +155,11 @@ module IBANTools
"SI56191000000123438",
"SK3112000000198742637541",
"SM86U0322509800000000270100",
"TL380080012345678910157",
"TN5914207207100707129648",
"TR330006100519786457841326",
"UA173052990006762462622943782"
"UA173052990006762462622943782",
"XK051212012345678906"
].each do |iban_code|
describe iban_code do
it "should be valid" do
Expand Down

0 comments on commit ec9b917

Please sign in to comment.