br_documents 0.1.3 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/config.yml +40 -0
- data/.rubocop.yml +73 -0
- data/.tool-versions +1 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +79 -42
- data/README.md +33 -0
- data/Rakefile +4 -4
- data/br_documents.gemspec +26 -19
- data/lib/br_documents/cnpj_cpf/cnpj.rb +2 -2
- data/lib/br_documents/cnpj_cpf/cpf.rb +2 -2
- data/lib/br_documents/cnpj_cpf/document.rb +9 -9
- data/lib/br_documents/cnpj_validator.rb +4 -4
- data/lib/br_documents/commons/mod11.rb +1 -2
- data/lib/br_documents/commons/mod14.rb +1 -2
- data/lib/br_documents/cpf_validator.rb +4 -4
- data/lib/br_documents/{gtin/gtin.rb → gtin.rb} +3 -3
- data/lib/br_documents/gtin_validator.rb +6 -6
- data/lib/br_documents/ie/ac.rb +3 -2
- data/lib/br_documents/ie/al.rb +2 -1
- data/lib/br_documents/ie/am.rb +3 -2
- data/lib/br_documents/ie/ap.rb +20 -16
- data/lib/br_documents/ie/ba.rb +28 -25
- data/lib/br_documents/ie/base.rb +1 -1
- data/lib/br_documents/ie/ce.rb +3 -2
- data/lib/br_documents/ie/df.rb +3 -2
- data/lib/br_documents/ie/es.rb +2 -1
- data/lib/br_documents/ie/factory.rb +3 -3
- data/lib/br_documents/ie/go.rb +3 -2
- data/lib/br_documents/ie/ma.rb +2 -1
- data/lib/br_documents/ie/mg.rb +14 -17
- data/lib/br_documents/ie/ms.rb +2 -1
- data/lib/br_documents/ie/mt.rb +6 -5
- data/lib/br_documents/ie/pa.rb +3 -2
- data/lib/br_documents/ie/pattern1.rb +10 -7
- data/lib/br_documents/ie/pattern2.rb +9 -8
- data/lib/br_documents/ie/pb.rb +3 -2
- data/lib/br_documents/ie/pe.rb +10 -10
- data/lib/br_documents/ie/pi.rb +2 -1
- data/lib/br_documents/ie/pr.rb +3 -2
- data/lib/br_documents/ie/rj.rb +3 -2
- data/lib/br_documents/ie/rn.rb +19 -16
- data/lib/br_documents/ie/ro.rb +16 -13
- data/lib/br_documents/ie/rr.rb +4 -3
- data/lib/br_documents/ie/rs.rb +3 -2
- data/lib/br_documents/ie/sc.rb +3 -2
- data/lib/br_documents/ie/se.rb +3 -2
- data/lib/br_documents/ie/sp.rb +17 -14
- data/lib/br_documents/ie/to.rb +6 -5
- data/lib/br_documents/ie_validator.rb +7 -7
- data/lib/br_documents/suframa.rb +46 -0
- data/lib/br_documents/suframa_validator.rb +8 -0
- data/lib/br_documents/version.rb +1 -1
- data/lib/br_documents.rb +3 -3
- data/spec/br_documents/cnpj_cpf/cnpj_spec.rb +59 -0
- data/spec/br_documents/cnpj_cpf/cpf_spec.rb +59 -0
- data/spec/br_documents/cnpj_validator_spec.rb +36 -0
- data/spec/br_documents/cpf_validator_spec.rb +36 -0
- data/spec/{gtin → br_documents}/gtin_spec.rb +4 -4
- data/spec/{gtin_validator_spec.rb → br_documents/gtin_validator_spec.rb} +14 -14
- data/spec/br_documents/ie/ac_spec.rb +43 -0
- data/spec/br_documents/ie/al_spec.rb +36 -0
- data/spec/br_documents/ie/am_spec.rb +43 -0
- data/spec/br_documents/ie/ap_spec.rb +36 -0
- data/spec/br_documents/ie/ba_spec.rb +69 -0
- data/spec/br_documents/ie/ce_spec.rb +16 -0
- data/spec/br_documents/ie/df_spec.rb +43 -0
- data/spec/br_documents/ie/es_spec.rb +16 -0
- data/spec/br_documents/ie/factory_spec.rb +202 -0
- data/spec/br_documents/ie/go_spec.rb +43 -0
- data/spec/br_documents/ie/ma_spec.rb +16 -0
- data/spec/br_documents/ie/mg_spec.rb +43 -0
- data/spec/br_documents/ie/ms_spec.rb +16 -0
- data/spec/br_documents/ie/mt_spec.rb +49 -0
- data/spec/br_documents/ie/pa_spec.rb +43 -0
- data/spec/br_documents/ie/pb_spec.rb +16 -0
- data/spec/br_documents/ie/pe_spec.rb +62 -0
- data/spec/br_documents/ie/pi_spec.rb +16 -0
- data/spec/br_documents/ie/pr_spec.rb +36 -0
- data/spec/br_documents/ie/rj_spec.rb +43 -0
- data/spec/br_documents/ie/rn_spec.rb +62 -0
- data/spec/br_documents/ie/ro_spec.rb +62 -0
- data/spec/br_documents/ie/rr_spec.rb +43 -0
- data/spec/br_documents/ie/rs_spec.rb +41 -0
- data/spec/br_documents/ie/sc_spec.rb +43 -0
- data/spec/br_documents/ie/se_spec.rb +16 -0
- data/spec/br_documents/ie/shared_examples_for_pattern1.rb +33 -0
- data/spec/br_documents/ie/shared_examples_for_to_remove_all_masks.rb +16 -0
- data/spec/br_documents/ie/sp_spec.rb +45 -0
- data/spec/br_documents/ie/to_spec.rb +100 -0
- data/spec/{ie_validator_spec.rb → br_documents/ie_validator_spec.rb} +12 -9
- data/spec/br_documents/suframa_spec.rb +73 -0
- data/spec/br_documents/suframa_validator_spec.rb +36 -0
- data/spec/spec_helper.rb +6 -6
- data/spec/support/utilities.rb +2 -2
- metadata +177 -99
- data/.circleci/config.yml +0 -42
- data/spec/cnpj_cpf/cnpj_spec.rb +0 -59
- data/spec/cnpj_cpf/cpf_spec.rb +0 -59
- data/spec/cnpj_validator_spec.rb +0 -36
- data/spec/cpf_validator_spec.rb +0 -36
- data/spec/ie/ac_spec.rb +0 -43
- data/spec/ie/al_spec.rb +0 -36
- data/spec/ie/am_spec.rb +0 -43
- data/spec/ie/ap_spec.rb +0 -36
- data/spec/ie/ba_spec.rb +0 -69
- data/spec/ie/ce_spec.rb +0 -16
- data/spec/ie/df_spec.rb +0 -43
- data/spec/ie/es_spec.rb +0 -16
- data/spec/ie/factory_spec.rb +0 -203
- data/spec/ie/go_spec.rb +0 -43
- data/spec/ie/ma_spec.rb +0 -16
- data/spec/ie/mg_spec.rb +0 -43
- data/spec/ie/ms_spec.rb +0 -16
- data/spec/ie/mt_spec.rb +0 -44
- data/spec/ie/pa_spec.rb +0 -43
- data/spec/ie/pb_spec.rb +0 -16
- data/spec/ie/pe_spec.rb +0 -62
- data/spec/ie/pi_spec.rb +0 -16
- data/spec/ie/pr_spec.rb +0 -36
- data/spec/ie/rj_spec.rb +0 -43
- data/spec/ie/rn_spec.rb +0 -62
- data/spec/ie/ro_spec.rb +0 -62
- data/spec/ie/rr_spec.rb +0 -43
- data/spec/ie/rs_spec.rb +0 -41
- data/spec/ie/sc_spec.rb +0 -43
- data/spec/ie/se_spec.rb +0 -16
- data/spec/ie/shared_examples_for_pattern1.rb +0 -33
- data/spec/ie/shared_examples_for_to_remove_all_masks.rb +0 -17
- data/spec/ie/sp_spec.rb +0 -45
- data/spec/ie/to_spec.rb +0 -100
data/spec/ie/ro_spec.rb
DELETED
@@ -1,62 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::RO do
|
5
|
-
describe "#formatted" do
|
6
|
-
context "when having 9 digits" do
|
7
|
-
it "returns a formatted ie" do
|
8
|
-
ie = described_class.new("123456789")
|
9
|
-
expect(ie.formatted).to eq "123.45678-9"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context "when having 14 digits" do
|
14
|
-
it "returns a formatted ie" do
|
15
|
-
ie = described_class.new("12345678901234")
|
16
|
-
expect(ie.formatted).to eq "1234567890123-4"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "#valid?" do
|
22
|
-
it "is invalid with malformed number" do
|
23
|
-
["20.049.788-6", "2.004.978-86", "937.03AB1-6"].each do |number|
|
24
|
-
ie = described_class.new(number)
|
25
|
-
expect(ie).to_not be_valid
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
it "is invalid with length different to 9 or 14" do
|
30
|
-
["1234567", "123456789012", "12345678901234567"].each do |number|
|
31
|
-
ie = described_class.new(number)
|
32
|
-
expect(ie).to_not be_valid
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "when having 9 digits" do
|
37
|
-
it "is invalid with invalid check number" do
|
38
|
-
ie = described_class.new("134725252")
|
39
|
-
expect(ie).to_not be_valid
|
40
|
-
end
|
41
|
-
|
42
|
-
it "is valid with valid number" do
|
43
|
-
ie = described_class.new("101625213")
|
44
|
-
expect(ie).to be_valid
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
context "when having 14 digits" do
|
49
|
-
it "is invalid with invalid check number" do
|
50
|
-
ie = described_class.new("02539835229263")
|
51
|
-
expect(ie).to_not be_valid
|
52
|
-
end
|
53
|
-
|
54
|
-
it "is valid with valid number" do
|
55
|
-
ie = described_class.new("00000003497861")
|
56
|
-
expect(ie).to be_valid
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
include_examples "for to remove all masks", "0000000062521-3"
|
61
|
-
end
|
62
|
-
end
|
data/spec/ie/rr_spec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::RR do
|
5
|
-
describe "#formatted" do
|
6
|
-
it "returns a formatted ie" do
|
7
|
-
ie = described_class.new("123456789")
|
8
|
-
expect(ie.formatted).to eq "12345678-9"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#valid?" do
|
13
|
-
it "is invalid with malformed number" do
|
14
|
-
["24.410.109-5", "2456128-32", "24AB0559-6"].each do |number|
|
15
|
-
ie = described_class.new(number)
|
16
|
-
expect(ie).to_not be_valid
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
it "is invalid with length different to 9" do
|
21
|
-
["1234567", "123456789"].each do |number|
|
22
|
-
ie = described_class.new(number)
|
23
|
-
expect(ie).to_not be_valid
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
it "is invalid with invalid check number" do
|
28
|
-
["242131962", "247318099"].each do |number|
|
29
|
-
ie = described_class.new(number)
|
30
|
-
expect(ie).to_not be_valid
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "is valid with valid number" do
|
35
|
-
["241432573", "240886456"].each do |number|
|
36
|
-
ie = described_class.new(number)
|
37
|
-
expect(ie).to be_valid
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
include_examples "for to remove all masks", "24088645-6"
|
42
|
-
end
|
43
|
-
end
|
data/spec/ie/rs_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::RS do
|
5
|
-
describe "#formatted" do
|
6
|
-
it "returns a formatted ie" do
|
7
|
-
ie = described_class.new("1234567890")
|
8
|
-
expect(ie.formatted).to eq "123/4567890"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#valid?" do
|
13
|
-
it "is invalid with malformed number" do
|
14
|
-
ie = described_class.new("17/70169293")
|
15
|
-
expect(ie).to_not be_valid
|
16
|
-
end
|
17
|
-
|
18
|
-
it "is invalid with length different to 10" do
|
19
|
-
["123456789", "12345678901"].each do |number|
|
20
|
-
ie = described_class.new(number)
|
21
|
-
expect(ie).to_not be_valid
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
it "is invalid with invalid check number" do
|
26
|
-
["1770169292", "034/0112114"].each do |number|
|
27
|
-
ie = described_class.new(number)
|
28
|
-
expect(ie).to_not be_valid
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
it "is valid with valid number" do
|
33
|
-
["1770169293", "034/0112115"].each do |number|
|
34
|
-
ie = described_class.new(number)
|
35
|
-
expect(ie).to be_valid
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
include_examples "for to remove all masks", "034/0112115"
|
40
|
-
end
|
41
|
-
end
|
data/spec/ie/sc_spec.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::SC do
|
5
|
-
describe "#formatted" do
|
6
|
-
it "returns a formatted ie" do
|
7
|
-
ie = described_class.new("123456789")
|
8
|
-
expect(ie.formatted).to eq "123.456.789"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "#valid?" do
|
13
|
-
it "is invalid with malformed number" do
|
14
|
-
["253.66.7852", "25.4062.407", "A12345678"].each do |number|
|
15
|
-
ie = described_class.new(number)
|
16
|
-
expect(ie).to_not be_valid
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
it "is invalid with length different to 9" do
|
21
|
-
["1234567890", "12345678"].each do |number|
|
22
|
-
ie = described_class.new(number)
|
23
|
-
expect(ie).to_not be_valid
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
it "is invalid with invalid check number" do
|
28
|
-
["253667853", "254.062.408"].each do |number|
|
29
|
-
ie = described_class.new(number)
|
30
|
-
expect(ie).to_not be_valid
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "is valid with valid number" do
|
35
|
-
["253667852", "254.062.407"].each do |number|
|
36
|
-
ie = described_class.new(number)
|
37
|
-
expect(ie).to be_valid
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
include_examples "for to remove all masks", "254.062.407"
|
42
|
-
end
|
43
|
-
end
|
data/spec/ie/se_spec.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_pattern1"
|
3
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
4
|
-
|
5
|
-
describe BrDocuments::IE::SE do
|
6
|
-
describe "#formatted" do
|
7
|
-
it "returns a formatted ie" do
|
8
|
-
ie = described_class.new("123456789")
|
9
|
-
expect(ie.formatted).to eq "12345678-9"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
it_behaves_like "a pattern1", "SE"
|
14
|
-
|
15
|
-
include_examples "for to remove all masks", "12345678-9"
|
16
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
shared_examples "a pattern1" do |uf|
|
4
|
-
describe BrDocuments::IE::Factory, "#valid?" do
|
5
|
-
it "is invalid with malformed number" do
|
6
|
-
["1922212-21", "72.219.398-0", "63BA9943-8"].each do |number|
|
7
|
-
ie = described_class.create(uf, number)
|
8
|
-
expect(ie).to_not be_valid
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
it "is invalid with length different to 9" do
|
13
|
-
["1234567", "12345678901"].each do |number|
|
14
|
-
ie = described_class.create(uf, number)
|
15
|
-
expect(ie).to_not be_valid
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
it "is invalid with invalid check number" do
|
20
|
-
["226905727", "662637732"].each do |number|
|
21
|
-
ie = described_class.create(uf, number)
|
22
|
-
expect(ie).to_not be_valid
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
it "is valid with valid number" do
|
27
|
-
["732766940", "665822081"].each do |number|
|
28
|
-
ie = described_class.create(uf, number)
|
29
|
-
expect(ie).to be_valid
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
shared_examples "for to remove all masks" do |valid_number_with_mask|
|
4
|
-
describe "#valid?" do
|
5
|
-
|
6
|
-
context "when the number is valid" do
|
7
|
-
subject { described_class.new(valid_number_with_mask) }
|
8
|
-
|
9
|
-
it "removes the mask" do
|
10
|
-
expect(subject).to be_valid
|
11
|
-
|
12
|
-
only_numbers = valid_number_with_mask.gsub(/[\.\/-]/, "")
|
13
|
-
expect(valid_number_with_mask).to eq only_numbers
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/spec/ie/sp_spec.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::SP do
|
5
|
-
describe "#formatted" do
|
6
|
-
context "when having 12 digits" do
|
7
|
-
it "returns a formatted ie" do
|
8
|
-
ie = described_class.new("110042490114")
|
9
|
-
expect(ie.formatted).to eq "110.042.490.114"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context "when having 13 digits" do
|
14
|
-
it "returns a formatted ie" do
|
15
|
-
ie = described_class.new("P011004243002")
|
16
|
-
expect(ie.formatted).to eq "P-01100424.3/002"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "#valid?" do
|
22
|
-
it "is invalid with malformed number" do
|
23
|
-
["36.9107.395114", "527.08212.8110"].each do |number|
|
24
|
-
ie = described_class.new(number)
|
25
|
-
expect(ie).to_not be_valid
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
it "is invalid with invalid check number" do
|
30
|
-
["110042490113", "110.042.491.114", "P-01100424.4/002"].each do |number|
|
31
|
-
ie = described_class.new(number)
|
32
|
-
expect(ie).to_not be_valid
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it "is valid with valid number" do
|
37
|
-
["110042490114", "110.042.490.114", "P-01100424.3/002"].each do |number|
|
38
|
-
ie = described_class.new(number)
|
39
|
-
expect(ie).to be_valid
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
include_examples "for to remove all masks", "P-01100424.3/002"
|
44
|
-
end
|
45
|
-
end
|
data/spec/ie/to_spec.rb
DELETED
@@ -1,100 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require_relative "shared_examples_for_to_remove_all_masks"
|
3
|
-
|
4
|
-
describe BrDocuments::IE::TO do
|
5
|
-
describe "#formatted" do
|
6
|
-
context "when having 9 digits" do
|
7
|
-
subject { described_class.new("123456789") }
|
8
|
-
|
9
|
-
it "returns a formatted ie" do
|
10
|
-
expect(subject.formatted).to eq "12.345678-9"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
context "when having 11 digits" do
|
15
|
-
subject { described_class.new("12345678901") }
|
16
|
-
|
17
|
-
it "returns a formatted ie" do
|
18
|
-
expect(subject.formatted).to eq "12.34.567890-1"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "#valid?" do
|
24
|
-
it "is invalid with malformed number" do
|
25
|
-
["2.903.593.362-3", "29.02.79268-45", "29.02.5AB420-5"].each do |number|
|
26
|
-
ie = described_class.new(number)
|
27
|
-
expect(ie).to_not be_valid
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
it "is invalid with length different of 9 or 11" do
|
32
|
-
["12345678", "1234567890", "123456789012"].each do |number|
|
33
|
-
ie = described_class.new(number)
|
34
|
-
expect(ie).to_not be_valid
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context "when having 9 digits" do
|
39
|
-
it "is invalid with invalid check number" do
|
40
|
-
["290227835", "294083153"].each do |number|
|
41
|
-
ie = described_class.new(number)
|
42
|
-
expect(ie).to_not be_valid
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
it "is invalid with correct check number but invalid mask" do
|
47
|
-
["29-022783-6", "29.408315.4"].each do |number|
|
48
|
-
ie = described_class.new(number)
|
49
|
-
expect(ie).to_not be_valid
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
it "is valid with valid number" do
|
54
|
-
["290227836", "294083154"].each do |number|
|
55
|
-
ie = described_class.new(number)
|
56
|
-
expect(ie).to be_valid
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
it "is valid with valid masked number" do
|
61
|
-
["29.022783-6", "29.408315-4"].each do |number|
|
62
|
-
ie = described_class.new(number)
|
63
|
-
expect(ie).to be_valid
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
context "when having 11 digits" do
|
69
|
-
it "is invalid with invalid check number" do
|
70
|
-
["29023864406", "29023864409"].each do |number|
|
71
|
-
ie = described_class.new(number)
|
72
|
-
expect(ie).to_not be_valid
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
it "is invalid with correct check number but invalid mask" do
|
77
|
-
["29-99.200143-6", "29.99.231741.7"].each do |number|
|
78
|
-
ie = described_class.new(number)
|
79
|
-
expect(ie).to_not be_valid
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
it "is valid with valid number" do
|
84
|
-
["29992001436", "29992317417"].each do |number|
|
85
|
-
ie = described_class.new(number)
|
86
|
-
expect(ie).to be_valid
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
it "is valid with valid masked number" do
|
91
|
-
["29.99.200143-6", "29.99.231741-7"].each do |number|
|
92
|
-
ie = described_class.new(number)
|
93
|
-
expect(ie).to be_valid
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
include_examples "for to remove all masks", "29.99.231741-7"
|
99
|
-
end
|
100
|
-
end
|