rfc_facil 1.2 → 1.2.1

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
  SHA256:
3
- metadata.gz: c55495422ff167a77169cd360ee2cc1f9e558a35c4abe9bba5e065588c275de7
4
- data.tar.gz: c0ae7aca6c61e4c7ebe74a45de2024dcb6582a93d62375fb76847b3a4c9de732
3
+ metadata.gz: fa9935d1300f96af23bdb9c0ea0733e4440f7b3b019354986f089378cd16fa95
4
+ data.tar.gz: 7e3119f0c502e6f2e1b0569bbbbc60cda0e6f967ee8b9467ef2edcd7d428b7f9
5
5
  SHA512:
6
- metadata.gz: 0ecf6e938dbaacb758b046769a373d616a5bc40b4148e8ca92519ac9b4e00b1973bc2fe7e3e56142b010b4840c62201509a3b61e99193d6e6c240af78b017c62
7
- data.tar.gz: 71982be1b7ba0cfa5f1d03d6d14cbc684920924454a6d3f36a8c779a931b496d4f9970a100cba53eeefa9c61e9d770c08d9882dea84511623ea0b6002a02a8e0
6
+ metadata.gz: 6415493c17767f148c8c50ca6884d8b127f21efbb6cd317e0f1d869538cad95a1c4cb092442c94d3207691db2cc351fb56023964bbf0708cf12e0ba5b5b15055
7
+ data.tar.gz: 60ed1915876d691ab84885374a7791b6a37972b1d7ff6296d51982c6458799bf36bb2a888f4306c9106bcfc82f999ceb55e9198839ab0f566e08b8e6f87d21c1
@@ -77,7 +77,7 @@ module RfcFacil
77
77
 
78
78
  def filter_name(name)
79
79
  raw_name = normalize(name).strip
80
- if raw_name.include?(' ') && (raw_name.start_with?( 'MARIA', 'JOSE'))
80
+ if raw_name.include?(' ') && (raw_name.start_with?('MA.', 'MARIA', 'JOSE') || raw_name.split(' ')[0] == 'MA')
81
81
  return raw_name.split(' ')[1]
82
82
  end
83
83
  name
@@ -1,3 +1,3 @@
1
1
  module RfcFacil
2
- VERSION = '1.2'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -24,6 +24,14 @@ class TestRfc < Minitest::Test
24
24
  assert_equal('A', rfc.verification_digit)
25
25
  assert_equal('AECS211112JPA', rfc.to_s)
26
26
 
27
+ rfc = RfcFacil::Rfc.new(name: 'MARCO ANTONIO', first_last_name: 'CANO',
28
+ second_last_name: 'BARRAZA', day: 25, month: 1, year: 1982)
29
+
30
+ assert_equal('CABM820125', rfc.ten_digits_code)
31
+ assert_equal('48', rfc.homoclave)
32
+ assert_equal('1', rfc.verification_digit)
33
+ assert_equal('CABM820125481', rfc.to_s)
34
+
27
35
  rfc = RfcFacil::Rfc.new(name: 'MA GLORIA', first_last_name: 'NAVARRO',
28
36
  second_last_name: 'VILLASANA', day: 29, month: 3, year: 1956)
29
37
 
@@ -31,14 +39,6 @@ class TestRfc < Minitest::Test
31
39
  assert_equal('62', rfc.homoclave)
32
40
  assert_equal('1', rfc.verification_digit)
33
41
  assert_equal('NAVG560329621', rfc.to_s)
34
-
35
- rfc = RfcFacil::Rfc.new(name: 'MARCO ANTONIO', first_last_name: 'CANO',
36
- second_last_name: 'barraza', day: 25, month: 1, year: 1982)
37
-
38
- assert_equal('CABA820125', rfc.ten_digits_code)
39
- assert_equal('48', rfc.homoclave)
40
- assert_equal('0', rfc.verification_digit)
41
- assert_equal('CABA820125480', rfc.to_s)
42
42
  end
43
43
 
44
44
  def test_rfc_for_a_juristic_person
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfc_facil
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Rangel