cpf_cnpj 0.4.1 → 0.5.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.
- checksums.yaml +5 -5
- data/lib/cnpj.rb +5 -0
- data/lib/cpf.rb +5 -0
- data/lib/cpf_cnpj/version.rb +1 -1
- data/test/unit/cnpj_test.rb +11 -0
- data/test/unit/cpf_test.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dae51c08f0746495d4b9470e710aea34f447b8ee11322554fa085e712d0f9f89
|
4
|
+
data.tar.gz: 2762cf150ab69f44c8c24d72da6c33dfd89db999dfacbccf329a66ac92477226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 562be436dbdebcf3f0730430fe36c72897d3ce894c4806b2c8298988233008f5e28a80250e42bb97e5d363e14ffd14dd16eca9716066582c8ccd8848e08654dd
|
7
|
+
data.tar.gz: 6476ab415fc627a01f69407a1c8624f997ed40d8745313cc2ca092bd61f2e424571bb7dcd3ee3a8cca57c0239611b4f74b4aa30b34ff74942fb57454c1c64256
|
data/lib/cnpj.rb
CHANGED
data/lib/cpf.rb
CHANGED
data/lib/cpf_cnpj/version.rb
CHANGED
data/test/unit/cnpj_test.rb
CHANGED
@@ -54,4 +54,15 @@ class CnpjTest < Minitest::Test
|
|
54
54
|
test "rejects strings (strict)" do
|
55
55
|
refute CNPJ.valid?("aa.bb.ccc/dddd-ee", strict: true)
|
56
56
|
end
|
57
|
+
|
58
|
+
test "compare objects by their numeric value" do
|
59
|
+
one = CNPJ.new("54550752000155")
|
60
|
+
other = CNPJ.new("54550752000155")
|
61
|
+
different = CNPJ.new("32228235377")
|
62
|
+
|
63
|
+
assert_equal one, other
|
64
|
+
|
65
|
+
refute_equal one, different
|
66
|
+
refute_equal other, different
|
67
|
+
end
|
57
68
|
end
|
data/test/unit/cpf_test.rb
CHANGED
@@ -79,4 +79,15 @@ class CpfTest < Minitest::Test
|
|
79
79
|
assert_equal "52139989171", cpf.stripped
|
80
80
|
assert_equal "521.399.891-71", cpf.formatted
|
81
81
|
end
|
82
|
+
|
83
|
+
test "compare objects by their numeric value" do
|
84
|
+
one = CPF.new("29537995593")
|
85
|
+
other = CPF.new("29537995593")
|
86
|
+
different = CPF.new("76556868310")
|
87
|
+
|
88
|
+
assert_equal one, other
|
89
|
+
|
90
|
+
refute_equal one, different
|
91
|
+
refute_equal other, different
|
92
|
+
end
|
82
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpf_cnpj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry-meta
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.6
|
114
|
+
rubygems_version: 2.7.6
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Validate, generate and format CPF/CNPJ numbers. Include command-line tools.
|