br_danfe 0.11.1 → 0.11.2

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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -0
  3. data/.rubocop.yml +113 -0
  4. data/Gemfile.lock +40 -19
  5. data/Rakefile +3 -3
  6. data/br_danfe.gemspec +7 -7
  7. data/lib/br_danfe.rb +14 -14
  8. data/lib/br_danfe/cce.rb +1 -0
  9. data/lib/br_danfe/cce_lib/barcode.rb +3 -2
  10. data/lib/br_danfe/cce_lib/correction.rb +3 -2
  11. data/lib/br_danfe/cce_lib/document.rb +15 -5
  12. data/lib/br_danfe/cce_lib/footer.rb +1 -1
  13. data/lib/br_danfe/cce_lib/header.rb +1 -1
  14. data/lib/br_danfe/cce_lib/nfe_key.rb +4 -3
  15. data/lib/br_danfe/cce_lib/protocol.rb +4 -3
  16. data/lib/br_danfe/danfe.rb +17 -17
  17. data/lib/br_danfe/danfe_lib/cep.rb +1 -1
  18. data/lib/br_danfe/danfe_lib/cst.rb +8 -6
  19. data/lib/br_danfe/danfe_lib/dest.rb +21 -23
  20. data/lib/br_danfe/danfe_lib/det_body.rb +20 -20
  21. data/lib/br_danfe/danfe_lib/document.rb +49 -36
  22. data/lib/br_danfe/danfe_lib/dup.rb +11 -10
  23. data/lib/br_danfe/danfe_lib/emit_header.rb +38 -34
  24. data/lib/br_danfe/danfe_lib/helper.rb +23 -23
  25. data/lib/br_danfe/danfe_lib/icmstot.rb +12 -12
  26. data/lib/br_danfe/danfe_lib/infadic.rb +1 -0
  27. data/lib/br_danfe/danfe_lib/issqn.rb +6 -6
  28. data/lib/br_danfe/danfe_lib/options.rb +6 -5
  29. data/lib/br_danfe/danfe_lib/phone.rb +2 -2
  30. data/lib/br_danfe/danfe_lib/ticket.rb +6 -4
  31. data/lib/br_danfe/danfe_lib/transp.rb +27 -26
  32. data/lib/br_danfe/danfe_lib/vol.rb +9 -8
  33. data/lib/br_danfe/danfe_lib/xml.rb +6 -6
  34. data/lib/br_danfe/danfe_lib/xprod.rb +22 -23
  35. data/lib/br_danfe/uf.rb +1 -4
  36. data/lib/br_danfe/version.rb +1 -1
  37. data/spec/features/cce_spec.rb +6 -6
  38. data/spec/features/danfe_spec.rb +25 -25
  39. data/spec/fixtures/cce/lib/barcode#render.pdf +5 -1
  40. data/spec/fixtures/cce/lib/correction#render.pdf +6 -2
  41. data/spec/fixtures/cce/lib/document#box.pdf +5 -1
  42. data/spec/fixtures/cce/lib/document#box.with.block.pdf +6 -2
  43. data/spec/fixtures/cce/lib/document#text.align.pdf +6 -2
  44. data/spec/fixtures/cce/lib/document#text.pad.pdf +6 -2
  45. data/spec/fixtures/cce/lib/document#text.simple.pdf +6 -2
  46. data/spec/fixtures/cce/lib/document#text.size.pdf +6 -2
  47. data/spec/fixtures/cce/lib/document#text.style.pdf +6 -2
  48. data/spec/fixtures/cce/lib/footer#render.pdf +6 -2
  49. data/spec/fixtures/cce/lib/header#render.pdf +6 -2
  50. data/spec/fixtures/cce/lib/nfe_key#render.pdf +7 -3
  51. data/spec/fixtures/cce/lib/protocol#render.pdf +7 -3
  52. data/spec/fixtures/cce/v1.00/cce.fixture.pdf +7 -3
  53. data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +7 -3
  54. data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +7 -3
  55. data/spec/fixtures/nfe/lib/dest#render-v4.00.pdf +7 -3
  56. data/spec/fixtures/nfe/lib/dest#render-with-address-bigger.pdf +7 -3
  57. data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +7 -3
  58. data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +7 -3
  59. data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +7 -3
  60. data/spec/fixtures/nfe/lib/dest#render-without-address-complement.pdf +7 -3
  61. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +383 -379
  62. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +233 -229
  63. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +158 -154
  64. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +158 -154
  65. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +158 -154
  66. data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +3697 -3685
  67. data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +3540 -3532
  68. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +158 -154
  69. data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +158 -154
  70. data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +1665 -1657
  71. data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +1665 -1657
  72. data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +6 -2
  73. data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +6 -2
  74. data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +6 -2
  75. data/spec/fixtures/nfe/lib/document#lie-blank-uf-invalid.pdf +6 -2
  76. data/spec/fixtures/nfe/lib/document#lie-blank.pdf +6 -2
  77. data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +6 -2
  78. data/spec/fixtures/nfe/lib/document#lie-valid.pdf +6 -2
  79. data/spec/fixtures/nfe/lib/dup#render.pdf +8 -4
  80. data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +9 -5
  81. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +9 -5
  82. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +7 -3
  83. data/spec/fixtures/nfe/lib/icmstot#render.pdf +7 -3
  84. data/spec/fixtures/nfe/lib/infadic#render-all_the_informations.pdf +8 -4
  85. data/spec/fixtures/nfe/lib/infadic#render-difal.pdf +7 -3
  86. data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +8 -4
  87. data/spec/fixtures/nfe/lib/infadic#render-with_complementary_information.pdf +7 -3
  88. data/spec/fixtures/nfe/lib/infadic#render-with_fisco_additional_information.pdf +7 -3
  89. data/spec/fixtures/nfe/lib/infadic#render-with_street_data.pdf +7 -3
  90. data/spec/fixtures/nfe/lib/infadic#render.pdf +7 -3
  91. data/spec/fixtures/nfe/lib/infadic_vol#render-extra_volume.pdf +7 -3
  92. data/spec/fixtures/nfe/lib/issqn#render-with_issqn.pdf +7 -3
  93. data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +7 -3
  94. data/spec/fixtures/nfe/lib/issqn#render-without_issqn.pdf +5 -1
  95. data/spec/fixtures/nfe/lib/ticket#render.pdf +6 -2
  96. data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +7 -3
  97. data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +7 -3
  98. data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +7 -3
  99. data/spec/fixtures/nfe/lib/transp#render-modfrete_3.pdf +7 -3
  100. data/spec/fixtures/nfe/lib/transp#render-modfrete_4.pdf +7 -3
  101. data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +7 -3
  102. data/spec/fixtures/nfe/lib/transp#render.pdf +7 -3
  103. data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +6 -2
  104. data/spec/fixtures/nfe/lib/vol#render.pdf +6 -2
  105. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +317 -313
  106. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +315 -311
  107. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +1297 -1289
  108. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +165 -161
  109. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +1297 -1289
  110. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +314 -310
  111. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +765 -761
  112. data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +1222 -1214
  113. data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +1222 -1214
  114. data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +4004 -3992
  115. data/spec/fixtures/nfe/v3.10/without_issqn.fixture.pdf +1522 -1514
  116. data/spec/lib/cce_lib/barcode_spec.rb +5 -5
  117. data/spec/lib/cce_lib/correction_spec.rb +5 -5
  118. data/spec/lib/cce_lib/document_spec.rb +23 -23
  119. data/spec/lib/cce_lib/footer_spec.rb +4 -4
  120. data/spec/lib/cce_lib/header_spec.rb +4 -4
  121. data/spec/lib/cce_lib/nfe_key_spec.rb +5 -5
  122. data/spec/lib/cce_lib/protocol_spec.rb +5 -5
  123. data/spec/lib/danfe_lib/cep_spec.rb +5 -5
  124. data/spec/lib/danfe_lib/cst_spec.rb +8 -8
  125. data/spec/lib/danfe_lib/dest_spec.rb +23 -23
  126. data/spec/lib/danfe_lib/det_body_spec.rb +26 -26
  127. data/spec/lib/danfe_lib/document_spec.rb +25 -25
  128. data/spec/lib/danfe_lib/dup_spec.rb +4 -4
  129. data/spec/lib/danfe_lib/emit_header_spec.rb +13 -13
  130. data/spec/lib/danfe_lib/helper_spec.rb +74 -74
  131. data/spec/lib/danfe_lib/icmstot_spec.rb +4 -4
  132. data/spec/lib/danfe_lib/infadic_spec.rb +6 -13
  133. data/spec/lib/danfe_lib/infadic_vol_spec.rb +1 -4
  134. data/spec/lib/danfe_lib/issqn_spec.rb +11 -11
  135. data/spec/lib/danfe_lib/logo_options_spec.rb +18 -18
  136. data/spec/lib/danfe_lib/options_spec.rb +7 -7
  137. data/spec/lib/danfe_lib/phone_spec.rb +10 -10
  138. data/spec/lib/danfe_lib/plate_spec.rb +9 -9
  139. data/spec/lib/danfe_lib/ticket_spec.rb +4 -4
  140. data/spec/lib/danfe_lib/transp_spec.rb +10 -10
  141. data/spec/lib/danfe_lib/vol_spec.rb +7 -7
  142. data/spec/lib/danfe_lib/xml_spec.rb +5 -5
  143. data/spec/lib/danfe_lib/xprod_spec.rb +48 -50
  144. data/spec/lib/uf_spec.rb +12 -12
  145. data/spec/support/have_same_content_of.rb +6 -6
  146. metadata +40 -10
@@ -1,9 +1,9 @@
1
- require "spec_helper"
1
+ require 'spec_helper'
2
2
 
3
3
  describe BrDanfe::DanfeLib::XML do
4
4
  subject { BrDanfe::DanfeLib::XML.new(xml_as_string) }
5
5
 
6
- describe "#version_is_310_or_newer?" do
6
+ describe '#version_is_310_or_newer?' do
7
7
  describe "when xml's version is equal 3.10" do
8
8
  let(:xml_as_string) do
9
9
  <<-eos
@@ -14,7 +14,7 @@ describe BrDanfe::DanfeLib::XML do
14
14
  eos
15
15
  end
16
16
 
17
- it "returns true" do
17
+ it 'returns true' do
18
18
  expect(subject.version_is_310_or_newer?).to eql true
19
19
  end
20
20
  end
@@ -29,7 +29,7 @@ describe BrDanfe::DanfeLib::XML do
29
29
  eos
30
30
  end
31
31
 
32
- it "returns true" do
32
+ it 'returns true' do
33
33
  expect(subject.version_is_310_or_newer?).to eql true
34
34
  end
35
35
  end
@@ -44,7 +44,7 @@ describe BrDanfe::DanfeLib::XML do
44
44
  eos
45
45
  end
46
46
 
47
- it "returns false" do
47
+ it 'returns false' do
48
48
  expect(subject.version_is_310_or_newer?).to eql false
49
49
  end
50
50
  end
@@ -1,10 +1,8 @@
1
- #encoding: utf-8
2
-
3
- require "spec_helper"
1
+ require 'spec_helper'
4
2
 
5
3
  describe BrDanfe::DanfeLib::Xprod do
6
- describe "#render" do
7
- context "when has FCI" do
4
+ describe '#render' do
5
+ context 'when has FCI' do
8
6
  let(:xml_fci) do
9
7
  xml = <<-eos
10
8
  <det nItem="1">
@@ -20,16 +18,16 @@ describe BrDanfe::DanfeLib::Xprod do
20
18
 
21
19
  subject { BrDanfe::DanfeLib::Xprod.new(xml_fci) }
22
20
 
23
- it "returns product + FCI" do
24
- expected = "MONITOR DE ARCO ELETRICO"
21
+ it 'returns product + FCI' do
22
+ expected = 'MONITOR DE ARCO ELETRICO'
25
23
  expected += "\n"
26
- expected += "FCI: 12232531-74B2-4FDD-87A6-CF0AD3E55386"
24
+ expected += 'FCI: 12232531-74B2-4FDD-87A6-CF0AD3E55386'
27
25
  expect(subject.render).to eq expected
28
26
  end
29
27
  end
30
28
 
31
- context "when has ST" do
32
- context "when is Retido" do
29
+ context 'when has ST' do
30
+ context 'when is Retido' do
33
31
  let(:vBCSTRet) { 0.00 }
34
32
  let(:pST) { 0.00 }
35
33
  let(:vICMSSTRet) { 0.00 }
@@ -70,45 +68,45 @@ describe BrDanfe::DanfeLib::Xprod do
70
68
 
71
69
  subject { BrDanfe::DanfeLib::Xprod.new(xml) }
72
70
 
73
- context "when has vBCSTRet" do
71
+ context 'when has vBCSTRet' do
74
72
  let(:vBCSTRet) { 50.00 }
75
73
 
76
- it "returns product + ST Retido" do
77
- expected = "MONITOR DE ARCO ELETRICO"
74
+ it 'returns product + ST Retido' do
75
+ expected = 'MONITOR DE ARCO ELETRICO'
78
76
  expected += "\n"
79
- expected += "ST Retido: Base: 50,00 * Alíq: 0,00% * Vlr: 0,00"
77
+ expected += 'ST Retido: Base: 50,00 * Alíq: 0,00% * Vlr: 0,00'
80
78
 
81
79
  expect(subject.render).to eq expected
82
80
  end
83
81
  end
84
82
 
85
- context "when has vICMSSTRet" do
83
+ context 'when has vICMSSTRet' do
86
84
  let(:vICMSSTRet) { 50.00 }
87
85
 
88
- it "returns product + ST Retido" do
89
- expected = "MONITOR DE ARCO ELETRICO"
86
+ it 'returns product + ST Retido' do
87
+ expected = 'MONITOR DE ARCO ELETRICO'
90
88
  expected += "\n"
91
- expected += "ST Retido: Base: 0,00 * Alíq: 0,00% * Vlr: 50,00"
89
+ expected += 'ST Retido: Base: 0,00 * Alíq: 0,00% * Vlr: 50,00'
92
90
 
93
91
  expect(subject.render).to eq expected
94
92
  end
95
93
  end
96
94
 
97
- context "when has pST" do
95
+ context 'when has pST' do
98
96
  let(:pST) { 50.00 }
99
97
 
100
- it "returns product + ST Retido" do
101
- expected = "MONITOR DE ARCO ELETRICO"
98
+ it 'returns product + ST Retido' do
99
+ expected = 'MONITOR DE ARCO ELETRICO'
102
100
  expected += "\n"
103
- expected += "ST Retido: Base: 0,00 * Alíq: 50,00% * Vlr: 0,00"
101
+ expected += 'ST Retido: Base: 0,00 * Alíq: 50,00% * Vlr: 0,00'
104
102
 
105
103
  expect(subject.render).to eq expected
106
104
  end
107
105
  end
108
106
 
109
107
  context "when doesn't have any fields" do
110
- it "returns product" do
111
- expected = "MONITOR DE ARCO ELETRICO"
108
+ it 'returns product' do
109
+ expected = 'MONITOR DE ARCO ELETRICO'
112
110
 
113
111
  expect(subject.render).to eq expected
114
112
  end
@@ -141,17 +139,17 @@ describe BrDanfe::DanfeLib::Xprod do
141
139
 
142
140
  subject { BrDanfe::DanfeLib::Xprod.new(xml_st) }
143
141
 
144
- it "returns product + ST" do
145
- expected = "MONITOR DE ARCO ELETRICO"
142
+ it 'returns product + ST' do
143
+ expected = 'MONITOR DE ARCO ELETRICO'
146
144
  expected += "\n"
147
- expected += "ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28"
145
+ expected += 'ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28'
148
146
 
149
147
  expect(subject.render).to eq expected
150
148
  end
151
149
  end
152
150
  end
153
151
 
154
- context "when has infAdProd" do
152
+ context 'when has infAdProd' do
155
153
  let(:xml_infAdProd) do
156
154
  xml = <<-eos
157
155
  <det nItem="1">
@@ -167,16 +165,16 @@ describe BrDanfe::DanfeLib::Xprod do
167
165
 
168
166
  subject { BrDanfe::DanfeLib::Xprod.new(xml_infAdProd) }
169
167
 
170
- it "returns product + infAdProd" do
171
- expected = "MONITOR DE ARCO ELETRICO"
168
+ it 'returns product + infAdProd' do
169
+ expected = 'MONITOR DE ARCO ELETRICO'
172
170
  expected += "\n"
173
- expected += "Informações adicionais do produto"
171
+ expected += 'Informações adicionais do produto'
174
172
 
175
173
  expect(subject.render).to eq expected
176
174
  end
177
175
  end
178
176
 
179
- context "when has FCP on ICMS00 tag" do
177
+ context 'when has FCP on ICMS00 tag' do
180
178
  let(:xml_fcp) do
181
179
  xml = <<-eos
182
180
  <det nItem="1">
@@ -200,16 +198,16 @@ describe BrDanfe::DanfeLib::Xprod do
200
198
 
201
199
  subject { BrDanfe::DanfeLib::Xprod.new(xml_fcp) }
202
200
 
203
- it "returns product + FCP" do
204
- expected = "MONITOR DE ARCO ELETRICO"
201
+ it 'returns product + FCP' do
202
+ expected = 'MONITOR DE ARCO ELETRICO'
205
203
  expected += "\n"
206
- expected += "FCP: Alíq: 2,00% * Vlr: 4,71"
204
+ expected += 'FCP: Alíq: 2,00% * Vlr: 4,71'
207
205
 
208
206
  expect(subject.render).to eq expected
209
207
  end
210
208
  end
211
209
 
212
- context "when has FCI + ST + infAdProd + FCP" do
210
+ context 'when has FCI + ST + infAdProd + FCP' do
213
211
  let(:xml_IFC_ST_infAdProd) do
214
212
  xml = <<-eos
215
213
  <det nItem="1">
@@ -241,22 +239,22 @@ describe BrDanfe::DanfeLib::Xprod do
241
239
 
242
240
  subject { BrDanfe::DanfeLib::Xprod.new(xml_IFC_ST_infAdProd) }
243
241
 
244
- it "returns product + FCI + ST + infAdProd" do
245
- expected = "MONITOR DE ARCO ELETRICO"
242
+ it 'returns product + FCI + ST + infAdProd' do
243
+ expected = 'MONITOR DE ARCO ELETRICO'
246
244
  expected += "\n"
247
- expected += "Informações adicionais do produto"
245
+ expected += 'Informações adicionais do produto'
248
246
  expected += "\n"
249
- expected += "FCI: 12232531-74B2-4FDD-87A6-CF0AD3E55386"
247
+ expected += 'FCI: 12232531-74B2-4FDD-87A6-CF0AD3E55386'
250
248
  expected += "\n"
251
- expected += "ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28"
249
+ expected += 'ST: MVA: 56,00% * Alíq: 17,00% * BC: 479,82 * Vlr: 29,28'
252
250
  expected += "\n"
253
- expected += "FCP: Alíq: 2,00% * Vlr: 4,71"
251
+ expected += 'FCP: Alíq: 2,00% * Vlr: 4,71'
254
252
 
255
253
  expect(subject.render).to eq expected
256
254
  end
257
255
  end
258
256
 
259
- context "when FCP is not in a ICMS00 tag" do
257
+ context 'when FCP is not in a ICMS00 tag' do
260
258
  let(:xml_fcp) do
261
259
  xml = <<-eos
262
260
  <det nItem="1">
@@ -281,16 +279,16 @@ describe BrDanfe::DanfeLib::Xprod do
281
279
 
282
280
  subject { BrDanfe::DanfeLib::Xprod.new(xml_fcp) }
283
281
 
284
- it "returns product + FCP" do
285
- expected = "MONITOR DE ARCO ELETRICO"
282
+ it 'returns product + FCP' do
283
+ expected = 'MONITOR DE ARCO ELETRICO'
286
284
  expected += "\n"
287
- expected += "FCP: Base: 235,50 * Alíq: 2,00% * Vlr: 4,71"
285
+ expected += 'FCP: Base: 235,50 * Alíq: 2,00% * Vlr: 4,71'
288
286
 
289
287
  expect(subject.render).to eq expected
290
288
  end
291
289
  end
292
290
 
293
- context "when has FCP ST" do
291
+ context 'when has FCP ST' do
294
292
  let(:xml_fcp) do
295
293
  xml = <<-eos
296
294
  <det nItem="1">
@@ -315,10 +313,10 @@ describe BrDanfe::DanfeLib::Xprod do
315
313
 
316
314
  subject { BrDanfe::DanfeLib::Xprod.new(xml_fcp) }
317
315
 
318
- it "returns product + FCP" do
319
- expected = "MONITOR DE ARCO ELETRICO"
316
+ it 'returns product + FCP' do
317
+ expected = 'MONITOR DE ARCO ELETRICO'
320
318
  expected += "\n"
321
- expected += "FCP ST: Base: 235,50 * Alíq: 2,00% * Vlr: 4,71"
319
+ expected += 'FCP ST: Base: 235,50 * Alíq: 2,00% * Vlr: 4,71'
322
320
 
323
321
  expect(subject.render).to eq expected
324
322
  end
data/spec/lib/uf_spec.rb CHANGED
@@ -3,15 +3,15 @@ require 'spec_helper'
3
3
  describe BrDanfe::Uf do
4
4
  describe '#include?' do
5
5
  ufs =
6
- [
7
- 'AC', 'AL', 'AP', 'AM', 'BA', 'CE', 'DF', 'ES', 'GO', 'MA', 'MT', 'MS', 'MG', 'PA', 'PB', 'PR', 'PE', 'PI', 'RJ',
8
- 'RN', 'RS', 'RO', 'RR', 'SC', 'SP', 'SE', 'TO'
6
+ %w[
7
+ AC AL AP AM BA CE DF ES GO MA MT MS MG PA PB PR PE PI RJ
8
+ RN RS RO RR SC SP SE TO
9
9
  ]
10
10
 
11
11
  context 'when uf is symbol' do
12
12
  ufs.each do |uf|
13
13
  it "returns true for uf #{uf}" do
14
- expect(BrDanfe::Uf.include? uf.to_sym).to be true
14
+ expect(BrDanfe::Uf.include?(uf.to_sym)).to be true
15
15
  end
16
16
  end
17
17
  end
@@ -19,27 +19,27 @@ describe BrDanfe::Uf do
19
19
  context 'when uf is string' do
20
20
  ufs.each do |uf|
21
21
  it "returns true for uf #{uf}" do
22
- expect(BrDanfe::Uf.include? uf).to be true
22
+ expect(BrDanfe::Uf.include?(uf)).to be true
23
23
  end
24
24
  end
25
25
  end
26
26
 
27
27
  context 'when uf is not from Brazil' do
28
- it "returns false" do
29
- expect(BrDanfe::Uf.include? 'EX').to be false
28
+ it 'returns false' do
29
+ expect(BrDanfe::Uf.include?('EX')).to be false
30
30
  end
31
31
  end
32
32
 
33
33
  context 'when uf is blank' do
34
- it "returns false" do
35
- expect(BrDanfe::Uf.include? '').to be false
34
+ it 'returns false' do
35
+ expect(BrDanfe::Uf.include?('')).to be false
36
36
  end
37
37
  end
38
38
 
39
39
  context 'when uf is nil' do
40
- it "returns false" do
41
- expect(BrDanfe::Uf.include? nil).to be false
40
+ it 'returns false' do
41
+ expect(BrDanfe::Uf.include?(nil)).to be false
42
42
  end
43
43
  end
44
44
  end
45
- end
45
+ end
@@ -2,7 +2,7 @@ RSpec::Matchers.define(:have_same_content_of) do |file: nil|
2
2
  expected_file_path = file
3
3
 
4
4
  match do |actual_file_path|
5
- if File.exists?(actual_file_path)
5
+ if File.exist?(actual_file_path)
6
6
  expect(md5_hash(actual_file_path)).to eq(md5_hash(expected_file_path))
7
7
  else
8
8
  create_when_missing(expected_file_path, actual_file_path)
@@ -14,13 +14,13 @@ RSpec::Matchers.define(:have_same_content_of) do |file: nil|
14
14
  end
15
15
 
16
16
  def create_when_missing(expected_file_path, actual_file_path)
17
- puts "+----------------------------------------------------"
18
- puts "|"
17
+ puts '+----------------------------------------------------'
18
+ puts '|'
19
19
  puts "| The file bellow doesn't exists and will be created:"
20
- puts "|"
20
+ puts '|'
21
21
  puts "| #{actual_file_path}"
22
- puts "|"
23
- puts "+----------------------------------------------------"
22
+ puts '|'
23
+ puts '+----------------------------------------------------'
24
24
 
25
25
  FileUtils.cp(expected_file_path, actual_file_path)
26
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_danfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-05 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: barby
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.15
33
+ version: 0.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.15
40
+ version: 0.1.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: i18n
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: prawn
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.1.0
75
+ version: '2.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.1.0
82
+ version: '2.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: prawn-table
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,34 @@ dependencies:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
138
  version: 3.6.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.67.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.67.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-performance
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 1.1.0
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 1.1.0
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: simplecov
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -174,6 +202,7 @@ files:
174
202
  - ".codeclimate.yml"
175
203
  - ".gitignore"
176
204
  - ".rspec"
205
+ - ".rubocop.yml"
177
206
  - Dockerfile
178
207
  - Gemfile
179
208
  - Gemfile.lock
@@ -352,14 +381,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
381
  requirements:
353
382
  - - ">="
354
383
  - !ruby/object:Gem::Version
355
- version: '2.1'
384
+ version: 2.5.1
356
385
  required_rubygems_version: !ruby/object:Gem::Requirement
357
386
  requirements:
358
387
  - - ">="
359
388
  - !ruby/object:Gem::Version
360
389
  version: '0'
361
390
  requirements: []
362
- rubygems_version: 3.0.3
391
+ rubyforge_project:
392
+ rubygems_version: 2.7.6
363
393
  signing_key:
364
394
  specification_version: 4
365
395
  summary: DANFE pdf generator for Brazilian invoices.