br_documents 0.0.15 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/config.yml +54 -0
  3. data/.gitignore +1 -1
  4. data/.rubocop.yml +65 -0
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +100 -0
  7. data/README.md +58 -1
  8. data/Rakefile +3 -3
  9. data/br_documents.gemspec +23 -19
  10. data/lib/br_documents.rb +3 -3
  11. data/lib/br_documents/cnpj_cpf/cnpj.rb +2 -2
  12. data/lib/br_documents/cnpj_cpf/cpf.rb +2 -2
  13. data/lib/br_documents/cnpj_cpf/document.rb +9 -9
  14. data/lib/br_documents/cnpj_validator.rb +4 -4
  15. data/lib/br_documents/commons/mod11.rb +1 -2
  16. data/lib/br_documents/commons/mod14.rb +20 -0
  17. data/lib/br_documents/cpf_validator.rb +4 -4
  18. data/lib/br_documents/gtin/gtin.rb +28 -0
  19. data/lib/br_documents/gtin_validator.rb +8 -0
  20. data/lib/br_documents/ie/ac.rb +3 -2
  21. data/lib/br_documents/ie/al.rb +2 -1
  22. data/lib/br_documents/ie/am.rb +3 -2
  23. data/lib/br_documents/ie/ap.rb +20 -16
  24. data/lib/br_documents/ie/ba.rb +28 -25
  25. data/lib/br_documents/ie/base.rb +1 -1
  26. data/lib/br_documents/ie/ce.rb +3 -2
  27. data/lib/br_documents/ie/df.rb +3 -2
  28. data/lib/br_documents/ie/es.rb +2 -1
  29. data/lib/br_documents/ie/factory.rb +3 -3
  30. data/lib/br_documents/ie/go.rb +3 -2
  31. data/lib/br_documents/ie/ma.rb +2 -1
  32. data/lib/br_documents/ie/mg.rb +14 -17
  33. data/lib/br_documents/ie/ms.rb +2 -1
  34. data/lib/br_documents/ie/mt.rb +6 -5
  35. data/lib/br_documents/ie/pa.rb +3 -2
  36. data/lib/br_documents/ie/pattern1.rb +10 -7
  37. data/lib/br_documents/ie/pattern2.rb +9 -8
  38. data/lib/br_documents/ie/pb.rb +3 -2
  39. data/lib/br_documents/ie/pe.rb +10 -10
  40. data/lib/br_documents/ie/pi.rb +2 -1
  41. data/lib/br_documents/ie/pr.rb +3 -2
  42. data/lib/br_documents/ie/rj.rb +3 -2
  43. data/lib/br_documents/ie/rn.rb +19 -16
  44. data/lib/br_documents/ie/ro.rb +17 -14
  45. data/lib/br_documents/ie/rr.rb +4 -3
  46. data/lib/br_documents/ie/rs.rb +3 -2
  47. data/lib/br_documents/ie/sc.rb +3 -2
  48. data/lib/br_documents/ie/se.rb +3 -2
  49. data/lib/br_documents/ie/sp.rb +17 -14
  50. data/lib/br_documents/ie/to.rb +6 -5
  51. data/lib/br_documents/ie_validator.rb +16 -15
  52. data/lib/br_documents/suframa/suframa.rb +60 -0
  53. data/lib/br_documents/suframa_validator.rb +8 -0
  54. data/lib/br_documents/version.rb +1 -1
  55. data/spec/cnpj_cpf/cnpj_spec.rb +21 -21
  56. data/spec/cnpj_cpf/cpf_spec.rb +21 -21
  57. data/spec/cnpj_validator_spec.rb +12 -12
  58. data/spec/cpf_validator_spec.rb +12 -12
  59. data/spec/gtin/gtin_spec.rb +49 -0
  60. data/spec/gtin_validator_spec.rb +47 -0
  61. data/spec/ie/ac_spec.rb +16 -16
  62. data/spec/ie/al_spec.rb +14 -14
  63. data/spec/ie/am_spec.rb +16 -16
  64. data/spec/ie/ap_spec.rb +14 -14
  65. data/spec/ie/ba_spec.rb +28 -28
  66. data/spec/ie/ce_spec.rb +9 -9
  67. data/spec/ie/df_spec.rb +16 -16
  68. data/spec/ie/es_spec.rb +9 -9
  69. data/spec/ie/factory_spec.rb +88 -89
  70. data/spec/ie/go_spec.rb +16 -16
  71. data/spec/ie/ma_spec.rb +9 -9
  72. data/spec/ie/mg_spec.rb +16 -16
  73. data/spec/ie/ms_spec.rb +9 -9
  74. data/spec/ie/mt_spec.rb +17 -17
  75. data/spec/ie/pa_spec.rb +16 -16
  76. data/spec/ie/pb_spec.rb +9 -9
  77. data/spec/ie/pe_spec.rb +27 -27
  78. data/spec/ie/pi_spec.rb +9 -9
  79. data/spec/ie/pr_spec.rb +14 -14
  80. data/spec/ie/rj_spec.rb +16 -16
  81. data/spec/ie/rn_spec.rb +27 -27
  82. data/spec/ie/ro_spec.rb +27 -27
  83. data/spec/ie/rr_spec.rb +16 -16
  84. data/spec/ie/rs_spec.rb +16 -16
  85. data/spec/ie/sc_spec.rb +16 -16
  86. data/spec/ie/se_spec.rb +9 -9
  87. data/spec/ie/shared_examples_for_pattern1.rb +11 -11
  88. data/spec/ie/shared_examples_for_to_remove_all_masks.rb +7 -8
  89. data/spec/ie/sp_spec.rb +19 -19
  90. data/spec/ie/to_spec.rb +35 -35
  91. data/spec/ie_validator_spec.rb +43 -31
  92. data/spec/spec_helper.rb +9 -6
  93. data/spec/suframa/suframa_spec.rb +109 -0
  94. data/spec/suframa_validator_spec.rb +36 -0
  95. data/spec/support/utilities.rb +2 -2
  96. metadata +94 -25
  97. data/.travis.yml +0 -6
  98. data/circle.yml +0 -3
data/spec/ie/ma_spec.rb CHANGED
@@ -1,16 +1,16 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_pattern1"
3
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_pattern1'
3
+ require_relative 'shared_examples_for_to_remove_all_masks'
4
4
 
5
5
  describe BrDocuments::IE::MA do
6
- describe "#formatted" do
7
- it "returns a formatted ie" do
8
- ie = described_class.new("123456789")
9
- expect(ie.formatted).to eq "123456789"
6
+ describe '#formatted' do
7
+ it 'returns a formatted ie' do
8
+ ie = described_class.new('123456789')
9
+ expect(ie.formatted).to eq '123456789'
10
10
  end
11
11
  end
12
12
 
13
- it_behaves_like "a pattern1", "MA"
13
+ it_behaves_like 'a pattern1', 'MA'
14
14
 
15
- include_examples "for to remove all masks", "12345678-9"
15
+ include_examples 'for to remove all masks', '12345678-9'
16
16
  end
data/spec/ie/mg_spec.rb CHANGED
@@ -1,43 +1,43 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  RSpec.describe BrDocuments::IE::MG do
5
- describe "#formatted" do
6
- it "returns a formatted ie" do
7
- ie = described_class.new("1234567890123")
8
- expect(ie.formatted).to eq "123.456.789/0123"
5
+ describe '#formatted' do
6
+ it 'returns a formatted ie' do
7
+ ie = described_class.new('1234567890123')
8
+ expect(ie.formatted).to eq '123.456.789/0123'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["36.311.266.571-75", "4.168.836.973-423", "560.139.778.87-BA"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['36.311.266.571-75', '4.168.836.973-423', '560.139.778.87-BA'].each do |number|
15
15
  ie = described_class.new(number)
16
16
  expect(ie).to_not be_valid
17
17
  end
18
18
  end
19
19
 
20
- it "is invalid with length different to 13" do
21
- ["123456789", "1234567890123"].each do |number|
20
+ it 'is invalid with length different to 13' do
21
+ ['123456789', '1234567890123'].each do |number|
22
22
  ie = described_class.new(number)
23
23
  expect(ie).to_not be_valid
24
24
  end
25
25
  end
26
26
 
27
- it "is invalid with invalid check number" do
28
- ["4193434759812", "9427301981832"].each do |number|
27
+ it 'is invalid with invalid check number' do
28
+ ['4193434759812', '9427301981832'].each do |number|
29
29
  ie = described_class.new(number)
30
30
  expect(ie).to_not be_valid
31
31
  end
32
32
  end
33
33
 
34
- it "is valid with valid number" do
35
- ["4193434759899", "9427301981820"].each do |number|
34
+ it 'is valid with valid number' do
35
+ ['4193434759899', '9427301981820'].each do |number|
36
36
  ie = described_class.new(number)
37
37
  expect(ie).to be_valid
38
38
  end
39
39
  end
40
40
 
41
- include_examples "for to remove all masks", "942.730.198.18-20"
41
+ include_examples 'for to remove all masks', '942.730.198.18-20'
42
42
  end
43
43
  end
data/spec/ie/ms_spec.rb CHANGED
@@ -1,16 +1,16 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_pattern1"
3
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_pattern1'
3
+ require_relative 'shared_examples_for_to_remove_all_masks'
4
4
 
5
5
  describe BrDocuments::IE::MS do
6
- describe "#formatted" do
7
- it "returns a formatted ie" do
8
- ie = described_class.new("123456789")
9
- expect(ie.formatted).to eq "123456789"
6
+ describe '#formatted' do
7
+ it 'returns a formatted ie' do
8
+ ie = described_class.new('123456789')
9
+ expect(ie.formatted).to eq '123456789'
10
10
  end
11
11
  end
12
12
 
13
- it_behaves_like "a pattern1", "MS"
13
+ it_behaves_like 'a pattern1', 'MS'
14
14
 
15
- include_examples "for to remove all masks", "12345678-9"
15
+ include_examples 'for to remove all masks', '12345678-9'
16
16
  end
data/spec/ie/mt_spec.rb CHANGED
@@ -1,44 +1,44 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  RSpec.describe BrDocuments::IE::MT do
5
- describe "#formatted" do
6
- it "returns a formatted ie" do
7
- ie = described_class.new("12345678901")
8
- expect(ie.formatted).to eq "1234567890-1"
5
+ describe '#formatted' do
6
+ it 'returns a formatted ie' do
7
+ ie = described_class.new('12345678901')
8
+ expect(ie.formatted).to eq '1234567890-1'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["82.060.187.373", "528843171-72", "AD402552219"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['82.060.187.373', '528843171-72', 'AD402552219'].each do |number|
15
15
  ie = described_class.new(number)
16
16
  expect(ie).to_not be_valid
17
17
  end
18
18
  end
19
19
 
20
- context "when the number is greater than 11" do
21
- subject { described_class.new("123456789012") }
20
+ context 'when the number is greater than 11' do
21
+ subject { described_class.new('123456789012') }
22
22
 
23
- it "is invalid" do
23
+ it 'is invalid' do
24
24
  expect(subject).to_not be_valid
25
25
  end
26
26
  end
27
27
 
28
- it "is invalid with invalid check number" do
29
- ["00404609123", "83646580222"].each do |number|
28
+ it 'is invalid with invalid check number' do
29
+ ['00404609123', '83646580222'].each do |number|
30
30
  ie = described_class.new(number)
31
31
  expect(ie).to_not be_valid
32
32
  end
33
33
  end
34
34
 
35
- it "is valid with valid number" do
36
- ["0013000001-9", "82060187373", "132631946", "13.263.194-6"].each do |number|
35
+ it 'is valid with valid number' do
36
+ ['0013000001-9', '82060187373', '132631946', '13.263.194-6'].each do |number|
37
37
  ie = described_class.new(number)
38
38
  expect(ie).to be_valid
39
39
  end
40
40
  end
41
41
 
42
- include_examples "for to remove all masks", "0013000001-9"
42
+ include_examples 'for to remove all masks', '0013000001-9'
43
43
  end
44
44
  end
data/spec/ie/pa_spec.rb CHANGED
@@ -1,43 +1,43 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  describe BrDocuments::IE::PA do
5
- describe "#formatted" do
6
- it "returns a formatted ie" do
7
- ie = described_class.new("123456789")
8
- expect(ie.formatted).to eq "12-345678-9"
5
+ describe '#formatted' do
6
+ it 'returns a formatted ie' do
7
+ ie = described_class.new('123456789')
8
+ expect(ie.formatted).to eq '12-345678-9'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["15.361.802-7", "15-48556-93", "15-4AB752-7"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['15.361.802-7', '15-48556-93', '15-4AB752-7'].each do |number|
15
15
  ie = described_class.new(number)
16
16
  expect(ie).to_not be_valid
17
17
  end
18
18
  end
19
19
 
20
- it "is invalid with length different to 9" do
21
- ["1234567", "12345678901"].each do |number|
20
+ it 'is invalid with length different to 9' do
21
+ ['1234567', '12345678901'].each do |number|
22
22
  ie = described_class.new(number)
23
23
  expect(ie).to_not be_valid
24
24
  end
25
25
  end
26
26
 
27
- it "is invalid with invalid check number" do
28
- ["152653852", "157252799"].each do |number|
27
+ it 'is invalid with invalid check number' do
28
+ ['152653852', '157252799'].each do |number|
29
29
  ie = described_class.new(number)
30
30
  expect(ie).to_not be_valid
31
31
  end
32
32
  end
33
33
 
34
- it "is valid with valid number" do
35
- ["159636841", "158667794"].each do |number|
34
+ it 'is valid with valid number' do
35
+ ['159636841', '158667794'].each do |number|
36
36
  ie = described_class.new(number)
37
37
  expect(ie).to be_valid
38
38
  end
39
39
  end
40
40
 
41
- include_examples "for to remove all masks", "15-866779-4"
41
+ include_examples 'for to remove all masks', '15-866779-4'
42
42
  end
43
43
  end
data/spec/ie/pb_spec.rb CHANGED
@@ -1,16 +1,16 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_pattern1"
3
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_pattern1'
3
+ require_relative 'shared_examples_for_to_remove_all_masks'
4
4
 
5
5
  describe BrDocuments::IE::PB 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"
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
10
  end
11
11
  end
12
12
 
13
- it_behaves_like "a pattern1", "PB"
13
+ it_behaves_like 'a pattern1', 'PB'
14
14
 
15
- include_examples "for to remove all masks", "12345678-9"
15
+ include_examples 'for to remove all masks', '12345678-9'
16
16
  end
data/spec/ie/pe_spec.rb CHANGED
@@ -1,62 +1,62 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  describe BrDocuments::IE::PE 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 "1234567-89"
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 '1234567-89'
10
10
  end
11
11
  end
12
12
 
13
- context "when having 14 digits" do
14
- it "returns a formatted ie" do
15
- ie = described_class.new("18100100000049")
16
- expect(ie.formatted).to eq "18.1.001.0000004-9"
13
+ context 'when having 14 digits' do
14
+ it 'returns a formatted ie' do
15
+ ie = described_class.new('18100100000049')
16
+ expect(ie.formatted).to eq '18.1.001.0000004-9'
17
17
  end
18
18
  end
19
19
  end
20
20
 
21
- describe "#valid?" do
22
- it "is invalid with malformed number" do
23
- ["15711188-1", "3.661.165-41", "3AB8287-00", "18.1.001.000000-49"].each do |number|
21
+ describe '#valid?' do
22
+ it 'is invalid with malformed number' do
23
+ ['15711188-1', '3.661.165-41', '3AB8287-00', '18.1.001.000000-49'].each do |number|
24
24
  ie = described_class.new(number)
25
25
  expect(ie).to_not be_valid
26
26
  end
27
27
  end
28
28
 
29
- it "is invalid with length different to 9 or 14" do
30
- ["1234567", "12345678901", "0123456789012345"].each do |number|
29
+ it 'is invalid with length different to 9 or 14' do
30
+ ['1234567', '12345678901', '0123456789012345'].each do |number|
31
31
  ie = described_class.new(number)
32
32
  expect(ie).to_not be_valid
33
33
  end
34
34
  end
35
35
 
36
- context "when having 9 digits" do
37
- it "is invalid with invalid check number" do
38
- ie = described_class.new("838872602")
36
+ context 'when having 9 digits' do
37
+ it 'is invalid with invalid check number' do
38
+ ie = described_class.new('838872602')
39
39
  expect(ie).to_not be_valid
40
40
  end
41
41
 
42
- it "is valid with valid number" do
43
- ie = described_class.new("418873607")
42
+ it 'is valid with valid number' do
43
+ ie = described_class.new('418873607')
44
44
  expect(ie).to be_valid
45
45
  end
46
46
  end
47
47
 
48
- context "when having 14 digits" do
49
- it "is invalid with invalid check number" do
50
- ie = described_class.new("18100100000048")
48
+ context 'when having 14 digits' do
49
+ it 'is invalid with invalid check number' do
50
+ ie = described_class.new('18100100000048')
51
51
  expect(ie).to_not be_valid
52
52
  end
53
53
 
54
- it "is valid with valid number" do
55
- ie = described_class.new("18100100000049")
54
+ it 'is valid with valid number' do
55
+ ie = described_class.new('18100100000049')
56
56
  expect(ie).to be_valid
57
57
  end
58
58
  end
59
59
 
60
- include_examples "for to remove all masks", "18.1.001.0000004-9"
60
+ include_examples 'for to remove all masks', '18.1.001.0000004-9'
61
61
  end
62
62
  end
data/spec/ie/pi_spec.rb CHANGED
@@ -1,16 +1,16 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_pattern1"
3
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_pattern1'
3
+ require_relative 'shared_examples_for_to_remove_all_masks'
4
4
 
5
5
  describe BrDocuments::IE::PI do
6
- describe "#formatted" do
7
- it "returns a formatted ie" do
8
- ie = described_class.new("123456789")
9
- expect(ie.formatted).to eq "123456789"
6
+ describe '#formatted' do
7
+ it 'returns a formatted ie' do
8
+ ie = described_class.new('123456789')
9
+ expect(ie.formatted).to eq '123456789'
10
10
  end
11
11
  end
12
12
 
13
- it_behaves_like "a pattern1", "PI"
13
+ it_behaves_like 'a pattern1', 'PI'
14
14
 
15
- include_examples "for to remove all masks", "12345678-9"
15
+ include_examples 'for to remove all masks', '12345678-9'
16
16
  end
data/spec/ie/pr_spec.rb CHANGED
@@ -1,36 +1,36 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  describe BrDocuments::IE::PR do
5
- describe "#formatted" do
6
- it "returns a formatted ie" do
7
- ie = described_class.new("1234567890")
8
- expect(ie.formatted).to eq "12345678-90"
5
+ describe '#formatted' do
6
+ it 'returns a formatted ie' do
7
+ ie = described_class.new('1234567890')
8
+ expect(ie.formatted).to eq '12345678-90'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["1016323-850", "10163238.50"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['1016323-850', '10163238.50'].each do |number|
15
15
  ie = described_class.new(number)
16
16
  expect(ie).to_not be_valid
17
17
  end
18
18
  end
19
19
 
20
- it "is invalid with invalid check number" do
21
- ["10163238-51", "10163238-40"].each do |number|
20
+ it 'is invalid with invalid check number' do
21
+ ['10163238-51', '10163238-40'].each do |number|
22
22
  ie = described_class.new(number)
23
23
  expect(ie).to_not be_valid
24
24
  end
25
25
  end
26
26
 
27
- it "is valid with valid number" do
28
- ["1016323850", "10163238-50"].each do |number|
27
+ it 'is valid with valid number' do
28
+ ['1016323850', '10163238-50'].each do |number|
29
29
  ie = described_class.new(number)
30
30
  expect(ie).to be_valid
31
31
  end
32
32
  end
33
33
 
34
- include_examples "for to remove all masks", "10163238-50"
34
+ include_examples 'for to remove all masks', '10163238-50'
35
35
  end
36
36
  end
data/spec/ie/rj_spec.rb CHANGED
@@ -1,43 +1,43 @@
1
- require "spec_helper"
2
- require_relative "shared_examples_for_to_remove_all_masks"
1
+ require 'spec_helper'
2
+ require_relative 'shared_examples_for_to_remove_all_masks'
3
3
 
4
4
  describe BrDocuments::IE::RJ do
5
- describe "#formatted" do
6
- it "returns a formatted ie" do
7
- ie = described_class.new("12345678")
8
- expect(ie.formatted).to eq "12.345.67-8"
5
+ describe '#formatted' do
6
+ it 'returns a formatted ie' do
7
+ ie = described_class.new('12345678')
8
+ expect(ie.formatted).to eq '12.345.67-8'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["00.55.55.25", "34.09.25-08", "0A220C18"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['00.55.55.25', '34.09.25-08', '0A220C18'].each do |number|
15
15
  ie = described_class.new(number)
16
16
  expect(ie).to_not be_valid
17
17
  end
18
18
  end
19
19
 
20
- it "is invalid with length different to 8" do
21
- ["1234567890", "12345"].each do |number|
20
+ it 'is invalid with length different to 8' do
21
+ ['1234567890', '12345'].each do |number|
22
22
  ie = described_class.new(number)
23
23
  expect(ie).to_not be_valid
24
24
  end
25
25
  end
26
26
 
27
- it "is invalid with invalid check number" do
28
- ["99228676", "48388923"].each do |number|
27
+ it 'is invalid with invalid check number' do
28
+ ['99228676', '48388923'].each do |number|
29
29
  ie = described_class.new(number)
30
30
  expect(ie).to_not be_valid
31
31
  end
32
32
  end
33
33
 
34
- it "is valid with valid number" do
35
- ["80172010", "31.864.95-0", "85.994.964"].each do |number|
34
+ it 'is valid with valid number' do
35
+ ['80172010', '31.864.95-0', '85.994.964'].each do |number|
36
36
  ie = described_class.new(number)
37
37
  expect(ie).to be_valid
38
38
  end
39
39
  end
40
40
 
41
- include_examples "for to remove all masks", "31.864.95-0"
41
+ include_examples 'for to remove all masks', '31.864.95-0'
42
42
  end
43
43
  end