bank-contact 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/README.md +23 -23
- data/Rakefile +5 -5
- data/bank.gemspec +10 -10
- data/data/iban.yml +265 -166
- data/lib/bank.rb +4 -4
- data/lib/bank/bban.rb +10 -10
- data/lib/bank/bic.rb +14 -15
- data/lib/bank/contact.rb +7 -7
- data/lib/bank/iban.rb +13 -13
- data/lib/bank/validators/iban_validator.rb +1 -1
- data/lib/bank/version.rb +1 -1
- data/spec/activemodel_spec.rb +10 -11
- data/spec/bic_spec.rb +64 -0
- data/spec/contact_spec.rb +13 -12
- data/spec/iban_spec.rb +114 -115
- data/spec/spec_helper.rb +1 -0
- metadata +5 -4
data/lib/bank.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require 'bank/version'
|
2
|
+
require 'pathname'
|
3
|
+
require 'yaml'
|
4
4
|
|
5
5
|
module Bank
|
6
6
|
def self.load_specifications(name)
|
7
|
-
YAML.load_file Pathname.new(__FILE__).dirname.parent +
|
7
|
+
YAML.load_file Pathname.new(__FILE__).dirname.parent + 'data' + "#{name}.yml"
|
8
8
|
end
|
9
9
|
end
|
data/lib/bank/bban.rb
CHANGED
@@ -5,36 +5,36 @@ module Bank
|
|
5
5
|
def initialize(country_code, code)
|
6
6
|
@country_code, @code = country_code, code
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def to_s
|
10
10
|
@code
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def valid?
|
14
14
|
valid_length? && !data.nil?
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
# the bban is the iban minus the first 4 characters (country_code, check_digits)
|
18
18
|
def valid_length?
|
19
19
|
specification && specification['length'] - 4 == @code.length
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
[:account_number, :bank_identifier, :branch_identifier].each do |m|
|
23
23
|
define_method(m) { data && data[m] }
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
private
|
27
|
-
|
27
|
+
|
28
28
|
def data
|
29
|
-
@code.match(/^#{specification['regexp']}$/) if specification
|
29
|
+
@code.match(/^#{specification['regexp']}$/x) if specification
|
30
30
|
end
|
31
|
-
|
31
|
+
|
32
32
|
def specification
|
33
33
|
@specification ||= self.class.specifications[@country_code.downcase]
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
def self.specifications
|
37
37
|
@@specs ||= Bank.load_specifications(:iban)
|
38
38
|
end
|
39
39
|
end
|
40
|
-
end
|
40
|
+
end
|
data/lib/bank/bic.rb
CHANGED
@@ -1,40 +1,39 @@
|
|
1
|
-
require
|
1
|
+
require 'bank/validators/bic_validator' if defined? ActiveModel
|
2
2
|
|
3
3
|
module Bank
|
4
4
|
class BIC
|
5
|
-
|
6
5
|
def self.valid?(code)
|
7
6
|
new(code).valid?
|
8
7
|
end
|
9
|
-
|
8
|
+
|
10
9
|
def initialize(code)
|
11
10
|
@code = code.to_s.strip.gsub(/\s+/, '').upcase
|
12
11
|
end
|
13
|
-
|
12
|
+
|
14
13
|
def bank_code
|
15
14
|
@code[0..3]
|
16
15
|
end
|
17
|
-
|
16
|
+
|
18
17
|
def country_code
|
19
18
|
@code[4..5]
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
def location_code
|
23
22
|
@code[6..7]
|
24
23
|
end
|
25
|
-
|
24
|
+
|
26
25
|
def branch_code
|
27
26
|
@code[8..10]
|
28
27
|
end
|
29
|
-
|
28
|
+
|
30
29
|
def to_s(formatted=false)
|
31
30
|
formatted ? "#{bank_code} #{country_code} #{location_code} #{branch_code}".strip : @code
|
32
31
|
end
|
33
|
-
|
32
|
+
|
34
33
|
def test?
|
35
34
|
location_code[1] == '0'
|
36
35
|
end
|
37
|
-
|
36
|
+
|
38
37
|
def passive?
|
39
38
|
location_code[1] == '1'
|
40
39
|
end
|
@@ -42,19 +41,19 @@ module Bank
|
|
42
41
|
def reverse_billing?
|
43
42
|
location_code[1] == '2'
|
44
43
|
end
|
45
|
-
|
44
|
+
|
46
45
|
def valid?
|
47
46
|
valid_length? && valid_format? && valid_location_code? && valid_branch_code?
|
48
47
|
end
|
49
|
-
|
48
|
+
|
50
49
|
def valid_length?
|
51
50
|
@code.length == 8 || @code.length == 11
|
52
51
|
end
|
53
|
-
|
52
|
+
|
54
53
|
def valid_format?
|
55
|
-
@code =~ /^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$/
|
54
|
+
!!(@code =~ /^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$/)
|
56
55
|
end
|
57
|
-
|
56
|
+
|
58
57
|
def valid_location_code?
|
59
58
|
location_code[0] != '0' && location_code[0] != '1' && location_code[1] != 'O'
|
60
59
|
end
|
data/lib/bank/contact.rb
CHANGED
@@ -4,30 +4,30 @@ require 'bank/bic'
|
|
4
4
|
module Bank
|
5
5
|
class Contact
|
6
6
|
attr_reader :iban, :bic
|
7
|
-
|
7
|
+
|
8
8
|
def initialize(iban, bic)
|
9
9
|
self.iban = iban
|
10
10
|
self.bic = bic
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def iban=(value)
|
14
14
|
@iban = IBAN.new(value)
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def bic=(value)
|
18
18
|
@bic = BIC.new(value)
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def valid?
|
22
22
|
iban.valid? && bic.valid?
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def to_h
|
26
26
|
{ iban: iban.to_s, bic: bic.to_s }
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def to_a
|
30
30
|
to_h.values
|
31
31
|
end
|
32
32
|
end
|
33
|
-
end
|
33
|
+
end
|
data/lib/bank/iban.rb
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require 'forwardable'
|
2
|
+
require 'bank/bban'
|
3
|
+
require 'bank/validators/iban_validator' if defined? ActiveModel
|
4
4
|
|
5
5
|
module Bank
|
6
6
|
class IBAN # International Bank Account Number
|
7
7
|
extend Forwardable
|
8
8
|
def_delegators :bban, :account_number, :bank_identifier, :branch_identifier
|
9
|
-
|
9
|
+
|
10
10
|
def self.valid?(code)
|
11
11
|
new(code).valid?
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def initialize(code)
|
15
15
|
@code = code.to_s.strip.gsub(/\s+/, '').upcase
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def country_code
|
19
19
|
@code[0..1]
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
def check_digits
|
23
23
|
@code[2..3]
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def bban
|
27
27
|
@bban ||= BBAN.new(country_code, @code[4..-1])
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def valid?
|
31
31
|
valid_check_digits? && bban.valid?
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
def valid_check_digits?
|
35
35
|
to_i % 97 == 1
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def to_i
|
39
39
|
"#{bban}#{country_code}#{check_digits}".each_char.map { |chr| chr.to_i(36) }.join.to_i
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def to_s(formatted=false)
|
43
43
|
formatted ? @code.gsub(/(.{4})/, '\1 ').strip : @code
|
44
44
|
end
|
45
45
|
end
|
46
|
-
end
|
46
|
+
end
|
data/lib/bank/version.rb
CHANGED
data/spec/activemodel_spec.rb
CHANGED
@@ -21,32 +21,31 @@ class Person
|
|
21
21
|
false
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
25
24
|
|
26
25
|
describe IbanValidator do
|
27
26
|
before {
|
28
27
|
@model = Company.new
|
29
28
|
}
|
30
|
-
|
31
|
-
it
|
29
|
+
|
30
|
+
it 'should be valid' do
|
32
31
|
@model.iban = 'FR1420041010050500013M02606'
|
33
32
|
@model.valid?.must_equal true
|
34
33
|
end
|
35
|
-
|
36
|
-
it
|
34
|
+
|
35
|
+
it 'should not be valid' do
|
37
36
|
@model.iban = 'FR1420041010050500013'
|
38
37
|
@model.valid?.must_equal false
|
39
|
-
@model.errors[:iban].must_include
|
38
|
+
@model.errors[:iban].must_include 'is invalid'
|
40
39
|
end
|
41
|
-
|
42
|
-
it
|
40
|
+
|
41
|
+
it 'should not validate with nil value' do
|
43
42
|
@model.iban.must_equal nil
|
44
43
|
@model.valid?.must_equal false
|
45
44
|
end
|
46
|
-
|
47
|
-
it
|
45
|
+
|
46
|
+
it 'should not use the validator with option allow_nil: true' do
|
48
47
|
@person = Person.new
|
49
48
|
@person.iban.must_equal nil
|
50
49
|
@person.valid?.must_equal true
|
51
50
|
end
|
52
|
-
end
|
51
|
+
end
|
data/spec/bic_spec.rb
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bank::BIC do
|
4
|
+
before do
|
5
|
+
@bic = Bank::BIC.new('ABNACHZ8XXX')
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'returns the right bank code' do
|
9
|
+
@bic.bank_code.must_equal 'ABNA'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'returns the right country code' do
|
13
|
+
@bic.country_code.must_equal 'CH'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns the right location code' do
|
17
|
+
@bic.location_code.must_equal 'Z8'
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'returns the right branch code' do
|
21
|
+
@bic.branch_code.must_equal 'XXX'
|
22
|
+
end
|
23
|
+
|
24
|
+
[8, 11].each do |len|
|
25
|
+
describe 'x' * len do
|
26
|
+
it 'has a valid length' do
|
27
|
+
Bank::BIC.new('x' * len).valid_length?.must_equal true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
1.upto(20) do |len|
|
33
|
+
if len != 8 && len != 11
|
34
|
+
describe 'x' * len do
|
35
|
+
it 'has a valid length' do
|
36
|
+
Bank::BIC.new('x' * len).valid_length?.must_equal false
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
[
|
43
|
+
'UCJAES2MXXX',
|
44
|
+
'ABAGATWWXXX',
|
45
|
+
'UCJAES2MXXX'
|
46
|
+
].each do |code|
|
47
|
+
describe code do
|
48
|
+
it 'has a valid format' do
|
49
|
+
Bank::BIC.new(code).valid_format?.must_equal true
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
[
|
55
|
+
'12341234'
|
56
|
+
].each do |code|
|
57
|
+
describe code do
|
58
|
+
it 'has an invalid format' do
|
59
|
+
Bank::BIC.new(code).valid_format?.must_equal false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
data/spec/contact_spec.rb
CHANGED
@@ -8,22 +8,23 @@ describe Bank::Contact do
|
|
8
8
|
@bic = Bank::BIC.new('BYLADEM1203')
|
9
9
|
@contact = Bank::Contact.new(@iban, @bic)
|
10
10
|
end
|
11
|
-
|
12
|
-
it
|
11
|
+
|
12
|
+
it 'should validate' do
|
13
13
|
@contact.valid?.must_equal true
|
14
14
|
end
|
15
|
-
|
16
|
-
it
|
15
|
+
|
16
|
+
it 'should have the right types' do
|
17
17
|
@contact.iban.must_be_kind_of Bank::IBAN
|
18
18
|
@contact.bic.must_be_kind_of Bank::BIC
|
19
19
|
end
|
20
|
-
|
21
|
-
it
|
22
|
-
@contact.to_h.must_equal(
|
23
|
-
|
24
|
-
|
25
|
-
it "should export to_a" do
|
26
|
-
@contact.to_a.must_equal(["FR1420041010050500013M02606", "BYLADEM1203"])
|
20
|
+
|
21
|
+
it 'should export to_h' do
|
22
|
+
@contact.to_h.must_equal(
|
23
|
+
iban: 'FR1420041010050500013M02606',
|
24
|
+
bic: 'BYLADEM1203')
|
27
25
|
end
|
28
26
|
|
29
|
-
|
27
|
+
it 'should export to_a' do
|
28
|
+
@contact.to_a.must_equal(['FR1420041010050500013M02606', 'BYLADEM1203'])
|
29
|
+
end
|
30
|
+
end
|
data/spec/iban_spec.rb
CHANGED
@@ -1,150 +1,149 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
3
|
describe Bank::IBAN do
|
5
4
|
before do
|
6
5
|
@iban = Bank::IBAN.new('FR14 2004 1010 0505 0001 3M026 06')
|
7
6
|
end
|
8
|
-
|
9
|
-
it
|
7
|
+
|
8
|
+
it 'should valid from class method' do
|
10
9
|
Bank::IBAN.valid?('FR14 2004 1010 0505 0001 3M026 06').must_equal true
|
11
10
|
end
|
12
|
-
|
13
|
-
it
|
11
|
+
|
12
|
+
it 'should load the validation rules' do
|
14
13
|
Bank.load_specifications(:iban).wont_be :empty?
|
15
14
|
Bank.load_specifications(:iban).must_be_kind_of Hash
|
16
15
|
end
|
17
16
|
|
18
|
-
it
|
19
|
-
@iban.country_code.must_equal
|
17
|
+
it 'should return the county code' do
|
18
|
+
@iban.country_code.must_equal 'FR'
|
20
19
|
end
|
21
|
-
|
22
|
-
it
|
23
|
-
@iban.check_digits.must_equal
|
20
|
+
|
21
|
+
it 'should return the check digits' do
|
22
|
+
@iban.check_digits.must_equal '14'
|
24
23
|
end
|
25
|
-
|
26
|
-
it
|
27
|
-
@iban.bban.must_be_kind_of Bank::BBAN
|
28
|
-
@iban.bban.to_s.must_equal
|
24
|
+
|
25
|
+
it 'should return the BBAN' do
|
26
|
+
@iban.bban.must_be_kind_of Bank::BBAN
|
27
|
+
@iban.bban.to_s.must_equal '20041010050500013M02606'
|
29
28
|
end
|
30
|
-
|
31
|
-
it
|
29
|
+
|
30
|
+
it 'should convert to integer value' do
|
32
31
|
@iban.to_i.must_equal 200410100505000132202606152714
|
33
32
|
end
|
34
|
-
|
35
|
-
it
|
33
|
+
|
34
|
+
it 'should convert to string' do
|
36
35
|
@iban.to_s.must_equal 'FR1420041010050500013M02606'
|
37
36
|
end
|
38
|
-
|
39
|
-
it
|
37
|
+
|
38
|
+
it 'should convert to formatted string' do
|
40
39
|
@iban.to_s(true).must_equal 'FR14 2004 1010 0505 0001 3M02 606'
|
41
40
|
end
|
42
41
|
|
43
|
-
it
|
42
|
+
it 'should respond_to? account_number' do
|
44
43
|
@iban.respond_to?(:account_number).must_equal true
|
45
44
|
end
|
46
45
|
|
47
|
-
it
|
48
|
-
@iban.account_number.must_equal
|
46
|
+
it 'should return account_number' do
|
47
|
+
@iban.account_number.must_equal '0500013M026'
|
49
48
|
end
|
50
|
-
|
51
|
-
it
|
52
|
-
@iban.bank_identifier.must_equal
|
49
|
+
|
50
|
+
it 'should return bank_identifier' do
|
51
|
+
@iban.bank_identifier.must_equal '20041'
|
53
52
|
end
|
54
|
-
|
55
|
-
it
|
56
|
-
@iban.branch_identifier.must_equal
|
53
|
+
|
54
|
+
it 'should return branch_identifier' do
|
55
|
+
@iban.branch_identifier.must_equal '01005'
|
57
56
|
end
|
58
|
-
|
57
|
+
|
59
58
|
[
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
#
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
#
|
119
|
-
|
120
|
-
|
121
|
-
#
|
122
|
-
#
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
59
|
+
'AL47212110090000000235698741',
|
60
|
+
'AD12 00012030200359100100',
|
61
|
+
'AT611904300234573201',
|
62
|
+
'BE68539007547034',
|
63
|
+
'BA391290079401028494',
|
64
|
+
'BG80BNBG96611020345678',
|
65
|
+
'HR1210010051863000160',
|
66
|
+
'CY17002001280000001200527600',
|
67
|
+
'CZ6508000000192000145399',
|
68
|
+
'DK5000400440116243',
|
69
|
+
'EE382200221020145685',
|
70
|
+
'FO1464600009692713',
|
71
|
+
'FI2112345600000785',
|
72
|
+
'FR1420041010050500013M02606',
|
73
|
+
'GE29NB0000000101904917',
|
74
|
+
'DE89370400440532013000',
|
75
|
+
'GI75NWBK000000007099453',
|
76
|
+
'GR1601101250000000012300695',
|
77
|
+
'GL8964710001000206',
|
78
|
+
'HU42117730161111101800000000',
|
79
|
+
'IS140159260076545510730339',
|
80
|
+
'IE29AIBK93115212345678',
|
81
|
+
'IT60X0542811101000000123456',
|
82
|
+
'LV80BANK0000435195001',
|
83
|
+
'LI21088100002324013AA',
|
84
|
+
'LT121000011101001000',
|
85
|
+
'LU280019400644750000',
|
86
|
+
'MK07300000000042425',
|
87
|
+
'MT84MALT011000012345MTLCAST001S',
|
88
|
+
'MD24AG000225100013104168',
|
89
|
+
'MC5813488000010051108001292',
|
90
|
+
'ME25505000012345678951',
|
91
|
+
'NL91ABNA0417164300',
|
92
|
+
'NO9386011117947',
|
93
|
+
'PL27114020040000300201355387',
|
94
|
+
'PT50000201231234567890154',
|
95
|
+
'RO49AAAA1B31007593840000',
|
96
|
+
'SM86U0322509800000000270100',
|
97
|
+
'RS35260005601001611379',
|
98
|
+
'SK3112000000198742637541',
|
99
|
+
'SI56191000000123438',
|
100
|
+
'ES9121000418450200051332',
|
101
|
+
'SE3550000000054910000003',
|
102
|
+
'CH9300762011623852957',
|
103
|
+
'UA573543470006762462054925026',
|
104
|
+
'GB29NWBK60161331926819',
|
105
|
+
# 'DZ4000400174401001050486',
|
106
|
+
'AO06000600000100037131174',
|
107
|
+
'AZ21NABZ00000000137010001944',
|
108
|
+
'BH29BMAG1299123456BH00',
|
109
|
+
'BJ11B00610100400271101192591',
|
110
|
+
'BR9700360305000010009795493P1',
|
111
|
+
'VG96VPVG0000012345678901',
|
112
|
+
'BF1030134020015400945000643',
|
113
|
+
'BI43201011067444',
|
114
|
+
'CM2110003001000500000605306',
|
115
|
+
'CV64000300004547069110176',
|
116
|
+
'FR7630007000110009970004942',
|
117
|
+
# 'CG5230011000202151234567890',
|
118
|
+
'CR0515202001026284066',
|
119
|
+
'DO28BAGR00000001212453611324',
|
120
|
+
# 'EG1100006001880800100014553',
|
121
|
+
# 'GA2140002000055602673300064',
|
122
|
+
'GT82TRAJ01020000001210029690',
|
123
|
+
'IR580540105180021273113007',
|
124
|
+
'IL620108000000099999999',
|
125
|
+
'CI05A00060174100178530011852',
|
126
|
+
'KZ176010251000042993',
|
127
|
+
'KW74NBOK0000000000001000372151',
|
128
|
+
'LB30099900000001001925579115',
|
129
|
+
'MG4600005030010101914016056',
|
130
|
+
'ML03D00890170001002120000447',
|
131
|
+
'MR1300012000010000002037372',
|
132
|
+
'MU17BOMM0101101030300200000MUR',
|
133
|
+
'MZ59000100000011834194157',
|
134
|
+
'PK24SCBL0000001171495101',
|
135
|
+
'PS92PALS000000000400123456702',
|
136
|
+
'PT50000200000163099310355',
|
137
|
+
'SA0380000000608010167519',
|
138
|
+
'SN12K00100152000025690007542',
|
139
|
+
'TN5914207207100707129648',
|
140
|
+
'TR330006100519786457841326',
|
141
|
+
'AE260211000000230064016'
|
143
142
|
].each do |code|
|
144
143
|
describe code do
|
145
|
-
it
|
144
|
+
it 'should be valid' do
|
146
145
|
Bank::IBAN.new(code).valid?.must_equal true
|
147
146
|
end
|
148
147
|
end
|
149
148
|
end
|
150
|
-
end
|
149
|
+
end
|