clabe_mx 0.1.2 → 0.3.0

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.
@@ -0,0 +1,33 @@
1
+ require 'clabe'
2
+
3
+ RSpec.describe 'Clabe' do
4
+ DATA_SET = [
5
+ { clabe: '12345678901234567', is_valid: false, bank_tag: nil, city: nil },
6
+ { clabe: '00000000000000000a', is_valid: false, bank_tag: nil, city: nil },
7
+ { clabe: '002010077777777779', is_valid: false, bank_tag: nil, city: nil },
8
+ { clabe: '000000000000000000', is_valid: false, bank_tag: nil, city: nil },
9
+ { clabe: '002114016003269412', is_valid: true, bank_tag: 'BANAMEX', city: 'Huixtla', code: '002' },
10
+ { clabe: '032180000118359719', is_valid: true, bank_tag: 'IXE', city: 'Atizapan, Chalco, Ciudad de México, Coacalco, Cuautitlán, Cuautitlán Izcalli, Ecatepec, Huehuetoca, Huixquilucan, Ixtapaluca, Los Reyes La Paz, Naucalpan, Nezahualcóyotl, Tecamac, Teotihuacán, Texcoco, Tlalnepantla', code: '032' }
11
+ ]
12
+
13
+ it 'validate' do
14
+ DATA_SET.each do |data|
15
+ raw_clabe = data[:clabe]
16
+ expected_validation = data[:is_valid]
17
+ expected_bank_tag = data[:bank_tag]
18
+ expected_city = data[:city]
19
+ expected_code = data[:code]
20
+
21
+ clabe_validation = Clabe.validate(raw_clabe)
22
+ actual_validation = clabe_validation.is_valid?
23
+ actual_bank_tag = clabe_validation.bank_tag
24
+ actual_city = clabe_validation.city
25
+ actual_code = clabe_validation.bank_code
26
+
27
+ expect(actual_validation).to eq(expected_validation)
28
+ expect(actual_bank_tag).to eq(expected_bank_tag)
29
+ expect(actual_city).to eq(expected_city)
30
+ expect(actual_code).to eq(expected_code)
31
+ end
32
+ end
33
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clabe_mx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yellowme
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2019-10-10 00:00:00.000000000 Z
@@ -30,12 +30,21 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - ".gitignore"
34
+ - Gemfile
35
+ - Gemfile.lock
36
+ - LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - clabe_mx.gemspec
33
40
  - lib/clabe.rb
41
+ - lib/clabe/version.rb
42
+ - spec/clabe_spec.rb
34
43
  homepage: https://rubygems.org/gems/clabe
35
44
  licenses:
36
45
  - MIT
37
46
  metadata: {}
38
- post_install_message:
47
+ post_install_message:
39
48
  rdoc_options: []
40
49
  require_paths:
41
50
  - lib
@@ -50,9 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
59
  - !ruby/object:Gem::Version
51
60
  version: '0'
52
61
  requirements: []
53
- rubyforge_project:
54
- rubygems_version: 2.7.6
55
- signing_key:
62
+ rubygems_version: 3.5.16
63
+ signing_key:
56
64
  specification_version: 4
57
65
  summary: Validate and get details from a CLABE
58
- test_files: []
66
+ test_files:
67
+ - spec/clabe_spec.rb