rfc_facil 1.2 → 1.2.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa9935d1300f96af23bdb9c0ea0733e4440f7b3b019354986f089378cd16fa95
|
4
|
+
data.tar.gz: 7e3119f0c502e6f2e1b0569bbbbc60cda0e6f967ee8b9467ef2edcd7d428b7f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/rfc_facil/version.rb
CHANGED
data/tests/rfc_facil/test_rfc.rb
CHANGED
@@ -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
|