br_documents 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/config.yml +54 -0
  3. data/.rubocop.yml +65 -0
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +76 -42
  6. data/README.md +33 -0
  7. data/Rakefile +3 -3
  8. data/br_documents.gemspec +23 -19
  9. data/lib/br_documents.rb +3 -3
  10. data/lib/br_documents/cnpj_cpf/cnpj.rb +2 -2
  11. data/lib/br_documents/cnpj_cpf/cpf.rb +2 -2
  12. data/lib/br_documents/cnpj_cpf/document.rb +9 -9
  13. data/lib/br_documents/cnpj_validator.rb +4 -4
  14. data/lib/br_documents/commons/mod11.rb +1 -2
  15. data/lib/br_documents/commons/mod14.rb +1 -2
  16. data/lib/br_documents/cpf_validator.rb +4 -4
  17. data/lib/br_documents/gtin/gtin.rb +1 -1
  18. data/lib/br_documents/gtin_validator.rb +6 -6
  19. data/lib/br_documents/ie/ac.rb +3 -2
  20. data/lib/br_documents/ie/al.rb +2 -1
  21. data/lib/br_documents/ie/am.rb +3 -2
  22. data/lib/br_documents/ie/ap.rb +20 -16
  23. data/lib/br_documents/ie/ba.rb +28 -25
  24. data/lib/br_documents/ie/base.rb +1 -1
  25. data/lib/br_documents/ie/ce.rb +3 -2
  26. data/lib/br_documents/ie/df.rb +3 -2
  27. data/lib/br_documents/ie/es.rb +2 -1
  28. data/lib/br_documents/ie/factory.rb +3 -3
  29. data/lib/br_documents/ie/go.rb +3 -2
  30. data/lib/br_documents/ie/ma.rb +2 -1
  31. data/lib/br_documents/ie/mg.rb +14 -17
  32. data/lib/br_documents/ie/ms.rb +2 -1
  33. data/lib/br_documents/ie/mt.rb +6 -5
  34. data/lib/br_documents/ie/pa.rb +3 -2
  35. data/lib/br_documents/ie/pattern1.rb +10 -7
  36. data/lib/br_documents/ie/pattern2.rb +9 -8
  37. data/lib/br_documents/ie/pb.rb +3 -2
  38. data/lib/br_documents/ie/pe.rb +10 -10
  39. data/lib/br_documents/ie/pi.rb +2 -1
  40. data/lib/br_documents/ie/pr.rb +3 -2
  41. data/lib/br_documents/ie/rj.rb +3 -2
  42. data/lib/br_documents/ie/rn.rb +19 -16
  43. data/lib/br_documents/ie/ro.rb +16 -13
  44. data/lib/br_documents/ie/rr.rb +4 -3
  45. data/lib/br_documents/ie/rs.rb +3 -2
  46. data/lib/br_documents/ie/sc.rb +3 -2
  47. data/lib/br_documents/ie/se.rb +3 -2
  48. data/lib/br_documents/ie/sp.rb +17 -14
  49. data/lib/br_documents/ie/to.rb +6 -5
  50. data/lib/br_documents/ie_validator.rb +7 -7
  51. data/lib/br_documents/suframa/suframa.rb +60 -0
  52. data/lib/br_documents/suframa_validator.rb +8 -0
  53. data/lib/br_documents/version.rb +1 -1
  54. data/spec/cnpj_cpf/cnpj_spec.rb +21 -21
  55. data/spec/cnpj_cpf/cpf_spec.rb +21 -21
  56. data/spec/cnpj_validator_spec.rb +12 -12
  57. data/spec/cpf_validator_spec.rb +12 -12
  58. data/spec/gtin/gtin_spec.rb +2 -2
  59. data/spec/gtin_validator_spec.rb +13 -13
  60. data/spec/ie/ac_spec.rb +16 -16
  61. data/spec/ie/al_spec.rb +14 -14
  62. data/spec/ie/am_spec.rb +16 -16
  63. data/spec/ie/ap_spec.rb +14 -14
  64. data/spec/ie/ba_spec.rb +28 -28
  65. data/spec/ie/ce_spec.rb +9 -9
  66. data/spec/ie/df_spec.rb +16 -16
  67. data/spec/ie/es_spec.rb +9 -9
  68. data/spec/ie/factory_spec.rb +88 -89
  69. data/spec/ie/go_spec.rb +16 -16
  70. data/spec/ie/ma_spec.rb +9 -9
  71. data/spec/ie/mg_spec.rb +16 -16
  72. data/spec/ie/ms_spec.rb +9 -9
  73. data/spec/ie/mt_spec.rb +17 -17
  74. data/spec/ie/pa_spec.rb +16 -16
  75. data/spec/ie/pb_spec.rb +9 -9
  76. data/spec/ie/pe_spec.rb +27 -27
  77. data/spec/ie/pi_spec.rb +9 -9
  78. data/spec/ie/pr_spec.rb +14 -14
  79. data/spec/ie/rj_spec.rb +16 -16
  80. data/spec/ie/rn_spec.rb +27 -27
  81. data/spec/ie/ro_spec.rb +27 -27
  82. data/spec/ie/rr_spec.rb +16 -16
  83. data/spec/ie/rs_spec.rb +16 -16
  84. data/spec/ie/sc_spec.rb +16 -16
  85. data/spec/ie/se_spec.rb +9 -9
  86. data/spec/ie/shared_examples_for_pattern1.rb +11 -11
  87. data/spec/ie/shared_examples_for_to_remove_all_masks.rb +7 -8
  88. data/spec/ie/sp_spec.rb +19 -19
  89. data/spec/ie/to_spec.rb +35 -35
  90. data/spec/ie_validator_spec.rb +7 -5
  91. data/spec/spec_helper.rb +6 -6
  92. data/spec/suframa/suframa_spec.rb +109 -0
  93. data/spec/suframa_validator_spec.rb +36 -0
  94. data/spec/support/utilities.rb +2 -2
  95. metadata +86 -23
  96. data/.circleci/config.yml +0 -42
data/spec/ie/es_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::ES 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", "ES"
13
+ it_behaves_like 'a pattern1', 'ES'
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
@@ -1,202 +1,201 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  describe BrDocuments::IE::Factory do
4
- describe ".create" do
5
- context "when uf is AC" do
6
- it "returns an instance of BrDocuments::IE::AC" do
7
- ie = BrDocuments::IE::Factory.create("AC", "123456789")
4
+ describe '.create' do
5
+ context 'when uf is AC' do
6
+ it 'returns an instance of BrDocuments::IE::AC' do
7
+ ie = BrDocuments::IE::Factory.create('AC', '123456789')
8
8
  expect(ie).to be_an_instance_of BrDocuments::IE::AC
9
9
  end
10
10
  end
11
11
 
12
- context "when uf is AL" do
13
- it "returns an instance of BrDocuments::IE::AL" do
14
- ie = BrDocuments::IE::Factory.create("AL", "123456789")
12
+ context 'when uf is AL' do
13
+ it 'returns an instance of BrDocuments::IE::AL' do
14
+ ie = BrDocuments::IE::Factory.create('AL', '123456789')
15
15
  expect(ie).to be_an_instance_of BrDocuments::IE::AL
16
16
  end
17
17
  end
18
18
 
19
- context "when uf is AP" do
20
- it "returns an instance of BrDocuments::IE::AP" do
21
- ie = BrDocuments::IE::Factory.create("AP", "123456789")
19
+ context 'when uf is AP' do
20
+ it 'returns an instance of BrDocuments::IE::AP' do
21
+ ie = BrDocuments::IE::Factory.create('AP', '123456789')
22
22
  expect(ie).to be_an_instance_of BrDocuments::IE::AP
23
23
  end
24
24
  end
25
25
 
26
- context "when uf is AM" do
27
- it "returns an instance of BrDocuments::IE::AM" do
28
- ie = BrDocuments::IE::Factory.create("AM", "123456789")
26
+ context 'when uf is AM' do
27
+ it 'returns an instance of BrDocuments::IE::AM' do
28
+ ie = BrDocuments::IE::Factory.create('AM', '123456789')
29
29
  expect(ie).to be_an_instance_of BrDocuments::IE::AM
30
30
  end
31
31
  end
32
32
 
33
- context "when uf is BA" do
34
- it "returns an instance of BrDocuments::IE::BA" do
35
- ie = BrDocuments::IE::Factory.create("BA", "123456789")
33
+ context 'when uf is BA' do
34
+ it 'returns an instance of BrDocuments::IE::BA' do
35
+ ie = BrDocuments::IE::Factory.create('BA', '123456789')
36
36
  expect(ie).to be_an_instance_of BrDocuments::IE::BA
37
37
  end
38
38
  end
39
39
 
40
- context "when uf is CE" do
41
- it "returns an instance of BrDocuments::IE::CE" do
42
- ie = BrDocuments::IE::Factory.create("CE", "123456789")
40
+ context 'when uf is CE' do
41
+ it 'returns an instance of BrDocuments::IE::CE' do
42
+ ie = BrDocuments::IE::Factory.create('CE', '123456789')
43
43
  expect(ie).to be_an_instance_of BrDocuments::IE::CE
44
44
  end
45
45
  end
46
46
 
47
- context "when uf is DF" do
48
- it "returns an instance of BrDocuments::IE::DF" do
49
- ie = BrDocuments::IE::Factory.create("DF", "123456789")
47
+ context 'when uf is DF' do
48
+ it 'returns an instance of BrDocuments::IE::DF' do
49
+ ie = BrDocuments::IE::Factory.create('DF', '123456789')
50
50
  expect(ie).to be_an_instance_of BrDocuments::IE::DF
51
51
  end
52
52
  end
53
53
 
54
- context "when uf is ES" do
55
- it "returns an instance of BrDocuments::IE::ES" do
56
- ie = BrDocuments::IE::Factory.create("ES", "123456789")
54
+ context 'when uf is ES' do
55
+ it 'returns an instance of BrDocuments::IE::ES' do
56
+ ie = BrDocuments::IE::Factory.create('ES', '123456789')
57
57
  expect(ie).to be_an_instance_of BrDocuments::IE::ES
58
58
  end
59
59
  end
60
60
 
61
- context "when uf is GO" do
62
- it "returns an instance of BrDocuments::IE::GO" do
63
- ie = BrDocuments::IE::Factory.create("GO", "123456789")
61
+ context 'when uf is GO' do
62
+ it 'returns an instance of BrDocuments::IE::GO' do
63
+ ie = BrDocuments::IE::Factory.create('GO', '123456789')
64
64
  expect(ie).to be_an_instance_of BrDocuments::IE::GO
65
65
  end
66
66
  end
67
67
 
68
- context "when uf is MA" do
69
- it "returns an instance of BrDocuments::IE::MA" do
70
- ie = BrDocuments::IE::Factory.create("MA", "123456789")
68
+ context 'when uf is MA' do
69
+ it 'returns an instance of BrDocuments::IE::MA' do
70
+ ie = BrDocuments::IE::Factory.create('MA', '123456789')
71
71
  expect(ie).to be_an_instance_of BrDocuments::IE::MA
72
72
  end
73
73
  end
74
74
 
75
- context "when uf is MG" do
76
- it "returns an instance of BrDocuments::IE::MG" do
77
- ie = BrDocuments::IE::Factory.create("MG", "123456789")
75
+ context 'when uf is MG' do
76
+ it 'returns an instance of BrDocuments::IE::MG' do
77
+ ie = BrDocuments::IE::Factory.create('MG', '123456789')
78
78
  expect(ie).to be_an_instance_of BrDocuments::IE::MG
79
79
  end
80
80
  end
81
81
 
82
- context "when uf is MS" do
83
- it "returns an instance of BrDocuments::IE::MS" do
84
- ie = BrDocuments::IE::Factory.create("MS", "123456789")
82
+ context 'when uf is MS' do
83
+ it 'returns an instance of BrDocuments::IE::MS' do
84
+ ie = BrDocuments::IE::Factory.create('MS', '123456789')
85
85
  expect(ie).to be_an_instance_of BrDocuments::IE::MS
86
86
  end
87
87
  end
88
88
 
89
- context "when uf is MT" do
90
- it "returns an instance of BrDocuments::IE::MT" do
91
- ie = BrDocuments::IE::Factory.create("MT", "123456789")
89
+ context 'when uf is MT' do
90
+ it 'returns an instance of BrDocuments::IE::MT' do
91
+ ie = BrDocuments::IE::Factory.create('MT', '123456789')
92
92
  expect(ie).to be_an_instance_of BrDocuments::IE::MT
93
93
  end
94
94
  end
95
95
 
96
- context "when uf is PA" do
97
- it "returns an instance of BrDocuments::IE::PA" do
98
- ie = BrDocuments::IE::Factory.create("PA", "123456789")
96
+ context 'when uf is PA' do
97
+ it 'returns an instance of BrDocuments::IE::PA' do
98
+ ie = BrDocuments::IE::Factory.create('PA', '123456789')
99
99
  expect(ie).to be_an_instance_of BrDocuments::IE::PA
100
100
  end
101
101
  end
102
102
 
103
- context "when uf is PB" do
104
- it "returns an instance of BrDocuments::IE::PB" do
105
- ie = BrDocuments::IE::Factory.create("PB", "123456789")
103
+ context 'when uf is PB' do
104
+ it 'returns an instance of BrDocuments::IE::PB' do
105
+ ie = BrDocuments::IE::Factory.create('PB', '123456789')
106
106
  expect(ie).to be_an_instance_of BrDocuments::IE::PB
107
107
  end
108
108
  end
109
109
 
110
- context "when uf is PR" do
111
- it "returns an instance of BrDocuments::IE::PR" do
112
- ie = BrDocuments::IE::Factory.create("PR", "123456789")
110
+ context 'when uf is PR' do
111
+ it 'returns an instance of BrDocuments::IE::PR' do
112
+ ie = BrDocuments::IE::Factory.create('PR', '123456789')
113
113
  expect(ie).to be_an_instance_of BrDocuments::IE::PR
114
114
  end
115
115
  end
116
116
 
117
- context "when uf is PE" do
118
- it "returns an instance of BrDocuments::IE::PE" do
119
- ie = BrDocuments::IE::Factory.create("PE", "123456789")
117
+ context 'when uf is PE' do
118
+ it 'returns an instance of BrDocuments::IE::PE' do
119
+ ie = BrDocuments::IE::Factory.create('PE', '123456789')
120
120
  expect(ie).to be_an_instance_of BrDocuments::IE::PE
121
121
  end
122
122
  end
123
123
 
124
- context "when uf is PI" do
125
- it "returns an instance of BrDocuments::IE::PI" do
126
- ie = BrDocuments::IE::Factory.create("PI", "123456789")
124
+ context 'when uf is PI' do
125
+ it 'returns an instance of BrDocuments::IE::PI' do
126
+ ie = BrDocuments::IE::Factory.create('PI', '123456789')
127
127
  expect(ie).to be_an_instance_of BrDocuments::IE::PI
128
128
  end
129
129
  end
130
130
 
131
- context "when uf is RJ" do
132
- it "returns an instance of BrDocuments::IE::RJ" do
133
- ie = BrDocuments::IE::Factory.create("RJ", "123456789")
131
+ context 'when uf is RJ' do
132
+ it 'returns an instance of BrDocuments::IE::RJ' do
133
+ ie = BrDocuments::IE::Factory.create('RJ', '123456789')
134
134
  expect(ie).to be_an_instance_of BrDocuments::IE::RJ
135
135
  end
136
136
  end
137
137
 
138
- context "when uf is returns" do
139
- it "returns an instance of BrDocuments::IE::RN" do
140
- ie = BrDocuments::IE::Factory.create("RN", "123456789")
138
+ context 'when uf is returns' do
139
+ it 'returns an instance of BrDocuments::IE::RN' do
140
+ ie = BrDocuments::IE::Factory.create('RN', '123456789')
141
141
  expect(ie).to be_an_instance_of BrDocuments::IE::RN
142
142
  end
143
143
  end
144
144
 
145
- context "when uf is RS" do
146
- it "returns an instance of BrDocuments::IE::RS" do
147
- ie = BrDocuments::IE::Factory.create("RS", "123456789")
145
+ context 'when uf is RS' do
146
+ it 'returns an instance of BrDocuments::IE::RS' do
147
+ ie = BrDocuments::IE::Factory.create('RS', '123456789')
148
148
  expect(ie).to be_an_instance_of BrDocuments::IE::RS
149
149
  end
150
150
  end
151
151
 
152
- context "when uf is RO" do
153
- it "returns an instance of BrDocuments::IE::RO" do
154
- ie = BrDocuments::IE::Factory.create("RO", "123456789")
152
+ context 'when uf is RO' do
153
+ it 'returns an instance of BrDocuments::IE::RO' do
154
+ ie = BrDocuments::IE::Factory.create('RO', '123456789')
155
155
  expect(ie).to be_an_instance_of BrDocuments::IE::RO
156
156
  end
157
157
  end
158
158
 
159
- context "when uf is RR" do
160
- it "returns an instance of BrDocuments::IE::RR" do
161
- ie = BrDocuments::IE::Factory.create("RR", "123456789")
159
+ context 'when uf is RR' do
160
+ it 'returns an instance of BrDocuments::IE::RR' do
161
+ ie = BrDocuments::IE::Factory.create('RR', '123456789')
162
162
  expect(ie).to be_an_instance_of BrDocuments::IE::RR
163
163
  end
164
164
  end
165
165
 
166
- context "when uf is SC" do
167
- it "returns an instance of BrDocuments::IE::SC" do
168
- ie = BrDocuments::IE::Factory.create("SC", "123456789")
166
+ context 'when uf is SC' do
167
+ it 'returns an instance of BrDocuments::IE::SC' do
168
+ ie = BrDocuments::IE::Factory.create('SC', '123456789')
169
169
  expect(ie).to be_an_instance_of BrDocuments::IE::SC
170
170
  end
171
171
  end
172
172
 
173
- context "when uf is SP" do
174
- it "returns an instance of BrDocuments::IE::SP" do
175
- ie = BrDocuments::IE::Factory.create("SP", "123456789")
173
+ context 'when uf is SP' do
174
+ it 'returns an instance of BrDocuments::IE::SP' do
175
+ ie = BrDocuments::IE::Factory.create('SP', '123456789')
176
176
  expect(ie).to be_an_instance_of BrDocuments::IE::SP
177
177
  end
178
178
  end
179
179
 
180
- context "when uf is SE" do
181
- it "returns an instance of BrDocuments::IE::SE" do
182
- ie = BrDocuments::IE::Factory.create("SE", "123456789")
180
+ context 'when uf is SE' do
181
+ it 'returns an instance of BrDocuments::IE::SE' do
182
+ ie = BrDocuments::IE::Factory.create('SE', '123456789')
183
183
  expect(ie).to be_an_instance_of BrDocuments::IE::SE
184
184
  end
185
185
  end
186
186
 
187
- context "when uf is TO" do
188
- it "returns an instance of BrDocuments::IE::TO" do
189
- ie = BrDocuments::IE::Factory.create("TO", "123456789")
187
+ context 'when uf is TO' do
188
+ it 'returns an instance of BrDocuments::IE::TO' do
189
+ ie = BrDocuments::IE::Factory.create('TO', '123456789')
190
190
  expect(ie).to be_an_instance_of BrDocuments::IE::TO
191
191
  end
192
192
  end
193
193
 
194
-
195
- context "when uf is invalid" do
196
- it "is returns an error" do
197
- expect{
198
- BrDocuments::IE::Factory.create("", "")
199
- }.to raise_error(ArgumentError, t("validator.ie.uf.invalid"))
194
+ context 'when uf is invalid' do
195
+ it 'is returns an error' do
196
+ expect do
197
+ BrDocuments::IE::Factory.create('', '')
198
+ end.to raise_error(ArgumentError, t('validator.ie.uf.invalid'))
200
199
  end
201
200
  end
202
201
  end
data/spec/ie/go_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::GO 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.345.678-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.345.678-9'
9
9
  end
10
10
  end
11
11
 
12
- describe "#valid?" do
13
- it "is invalid with malformed number" do
14
- ["01.390415.9", "280541-600", "1C78150A5"].each do |number|
12
+ describe '#valid?' do
13
+ it 'is invalid with malformed number' do
14
+ ['01.390415.9', '280541-600', '1C78150A5'].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", "122345678901"].each do |number|
20
+ it 'is invalid with length different to 9' do
21
+ ['1234567', '122345678901'].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
- ["903473566", "493184742"].each do |number|
27
+ it 'is invalid with invalid check number' do
28
+ ['903473566', '493184742'].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
- ["155432214", "916876470"].each do |number|
34
+ it 'is valid with valid number' do
35
+ ['155432214', '916876470'].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", "91.687.647-0"
41
+ include_examples 'for to remove all masks', '91.687.647-0'
42
42
  end
43
43
  end
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