br_danfe 0.15.1 → 0.17.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +20 -8
  3. data/.github/dependabot.yml +19 -0
  4. data/.rubocop.yml +24 -11
  5. data/.tool-versions +1 -0
  6. data/Gemfile.lock +69 -50
  7. data/Guardfile +4 -2
  8. data/README.md +23 -0
  9. data/bin/_guard-core +29 -0
  10. data/bin/guard +29 -0
  11. data/br_danfe.gemspec +9 -7
  12. data/lib/br_danfe/danfe_lib/nfce.rb +11 -9
  13. data/lib/br_danfe/danfe_lib/nfce_lib/document.rb +1 -1
  14. data/lib/br_danfe/danfe_lib/nfce_lib/footer.rb +2 -2
  15. data/lib/br_danfe/danfe_lib/nfce_lib/header.rb +30 -16
  16. data/lib/br_danfe/danfe_lib/nfce_lib/key.rb +3 -3
  17. data/lib/br_danfe/danfe_lib/nfce_lib/nfce_identification.rb +3 -3
  18. data/lib/br_danfe/danfe_lib/nfce_lib/product_list.rb +44 -53
  19. data/lib/br_danfe/danfe_lib/nfce_lib/recipient.rb +1 -1
  20. data/lib/br_danfe/danfe_lib/nfce_lib/total_list.rb +16 -15
  21. data/lib/br_danfe/danfe_lib/nfe.rb +11 -9
  22. data/lib/br_danfe/danfe_lib/nfe_lib/dest.rb +1 -1
  23. data/lib/br_danfe/danfe_lib/nfe_lib/dup.rb +1 -2
  24. data/lib/br_danfe/danfe_lib/nfe_lib/emit_header.rb +5 -6
  25. data/lib/br_danfe/danfe_lib/nfe_lib/infadic.rb +2 -1
  26. data/lib/br_danfe/document_builder.rb +1 -1
  27. data/lib/br_danfe/helper.rb +8 -10
  28. data/lib/br_danfe/mdfe.rb +55 -0
  29. data/lib/br_danfe/mdfe_lib/authorization_protocol.rb +24 -0
  30. data/lib/br_danfe/mdfe_lib/document.rb +26 -0
  31. data/lib/br_danfe/mdfe_lib/drivers.rb +70 -0
  32. data/lib/br_danfe/mdfe_lib/fisco_control.rb +21 -0
  33. data/lib/br_danfe/mdfe_lib/header.rb +77 -0
  34. data/lib/br_danfe/mdfe_lib/mdfe_identification.rb +69 -0
  35. data/lib/br_danfe/mdfe_lib/notes.rb +94 -0
  36. data/lib/br_danfe/mdfe_lib/totalizer.rb +57 -0
  37. data/lib/br_danfe/mdfe_lib/vehicles.rb +80 -0
  38. data/lib/br_danfe/qr_code.rb +21 -0
  39. data/lib/br_danfe/version.rb +1 -1
  40. data/lib/br_danfe.rb +2 -2
  41. data/spec/br_danfe/danfe_lib/nfce_lib/footer_spec.rb +3 -2
  42. data/spec/br_danfe/danfe_lib/nfce_lib/header_spec.rb +6 -4
  43. data/spec/br_danfe/danfe_lib/nfce_lib/helper_spec.rb +2 -2
  44. data/spec/br_danfe/danfe_lib/nfce_lib/key_spec.rb +2 -2
  45. data/spec/br_danfe/danfe_lib/nfce_lib/nfce_identification_spec.rb +2 -2
  46. data/spec/br_danfe/danfe_lib/nfce_lib/recipient_spec.rb +10 -10
  47. data/spec/br_danfe/danfe_lib/nfce_lib/total_list_spec.rb +12 -12
  48. data/spec/br_danfe/danfe_lib/nfce_spec.rb +2 -1
  49. data/spec/br_danfe/danfe_lib/nfe_lib/cst_spec.rb +4 -4
  50. data/spec/br_danfe/danfe_lib/nfe_lib/dest_spec.rb +178 -178
  51. data/spec/br_danfe/danfe_lib/nfe_lib/det_body_spec.rb +274 -274
  52. data/spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb +77 -77
  53. data/spec/br_danfe/danfe_lib/nfe_lib/dup_spec.rb +23 -23
  54. data/spec/br_danfe/danfe_lib/nfe_lib/emit_header_spec.rb +37 -37
  55. data/spec/br_danfe/danfe_lib/nfe_lib/helper_spec.rb +34 -34
  56. data/spec/br_danfe/danfe_lib/nfe_lib/icmstot_spec.rb +19 -19
  57. data/spec/br_danfe/danfe_lib/nfe_lib/infadic_spec.rb +240 -240
  58. data/spec/br_danfe/danfe_lib/nfe_lib/infadic_vol_spec.rb +3 -2
  59. data/spec/br_danfe/danfe_lib/nfe_lib/issqn_spec.rb +16 -16
  60. data/spec/br_danfe/danfe_lib/nfe_lib/ticket_spec.rb +13 -13
  61. data/spec/br_danfe/danfe_lib/nfe_lib/transp_spec.rb +76 -76
  62. data/spec/br_danfe/danfe_lib/nfe_lib/vol_spec.rb +40 -40
  63. data/spec/br_danfe/danfe_lib/nfe_lib/xprod_spec.rb +118 -118
  64. data/spec/br_danfe/danfe_spec.rb +2 -2
  65. data/spec/br_danfe/helper_spec.rb +26 -14
  66. data/spec/br_danfe/mdfe_lib/authorization_protocol_spec.rb +35 -0
  67. data/spec/br_danfe/mdfe_lib/document_spec.rb +20 -0
  68. data/spec/br_danfe/mdfe_lib/drivers_spec.rb +88 -0
  69. data/spec/br_danfe/mdfe_lib/fisco_control_spec.rb +69 -0
  70. data/spec/br_danfe/mdfe_lib/header_spec.rb +135 -0
  71. data/spec/br_danfe/mdfe_lib/mdfe_identification_spec.rb +104 -0
  72. data/spec/br_danfe/mdfe_lib/notes_spec.rb +97 -0
  73. data/spec/br_danfe/mdfe_lib/totalizer_spec.rb +63 -0
  74. data/spec/br_danfe/mdfe_lib/vehicles_spec.rb +66 -0
  75. data/spec/br_danfe/mdfe_spec.rb +45 -0
  76. data/spec/br_danfe/qr_code_spec.rb +31 -0
  77. data/spec/br_danfe/xml_spec.rb +6 -6
  78. data/spec/fixtures/mdfe/lib/document#render.pdf +0 -0
  79. data/spec/fixtures/mdfe/lib/document#text.align.pdf +0 -0
  80. data/spec/fixtures/mdfe/lib/document#text.pad.pdf +0 -0
  81. data/spec/fixtures/mdfe/lib/document#text.simple.pdf +0 -0
  82. data/spec/fixtures/mdfe/lib/document#text.size.pdf +0 -0
  83. data/spec/fixtures/mdfe/lib/document#text.style.pdf +0 -0
  84. data/spec/fixtures/mdfe/lib/fisco_control#barcode.pdf +0 -0
  85. data/spec/fixtures/mdfe/lib/fisco_control#without-barcode.pdf +0 -0
  86. data/spec/fixtures/mdfe/lib/header#render-qr-code.pdf +0 -0
  87. data/spec/fixtures/mdfe/lib/header#render-with_logo.pdf +0 -0
  88. data/spec/fixtures/mdfe/lib/header#render-without-qr-code.pdf +0 -0
  89. data/spec/fixtures/mdfe/lib/header#render-without_logo.pdf +0 -0
  90. data/spec/fixtures/mdfe/lib/mdfe-with-multiple-pages.pdf +1945 -0
  91. data/spec/fixtures/mdfe/lib/mdfe.fixture.pdf +1286 -0
  92. data/spec/fixtures/mdfe/lib/notes#render-big-aditional-information.pdf +1943 -0
  93. data/spec/fixtures/mdfe/lib/xml-mdfe-multiples-pages.xml +116 -0
  94. data/spec/fixtures/mdfe/lib/xml-mdfe.xml +250 -0
  95. data/spec/fixtures/nfce/lib/document#render.pdf +12 -23
  96. data/spec/fixtures/nfce/lib/footer#render-with_additional_information.pdf +0 -0
  97. data/spec/fixtures/nfce/lib/footer#render.pdf +0 -0
  98. data/spec/fixtures/nfce/lib/header#render-homologation.pdf +0 -0
  99. data/spec/fixtures/nfce/lib/header#render-long_name_with_logo.pdf +0 -0
  100. data/spec/fixtures/nfce/lib/header#render-long_name_without_logo.pdf +0 -0
  101. data/spec/fixtures/nfce/lib/header#render-short_name_with_logo.pdf +0 -0
  102. data/spec/fixtures/nfce/lib/header#render-short_name_without_logo.pdf +0 -0
  103. data/spec/fixtures/nfce/lib/key#render.pdf +0 -0
  104. data/spec/fixtures/nfce/lib/nfce_identification#render.pdf +0 -0
  105. data/spec/fixtures/nfce/lib/product_list#render-with_many_products.pdf +0 -0
  106. data/spec/fixtures/nfce/lib/product_list#render-with_many_products_and_long_names.pdf +0 -0
  107. data/spec/fixtures/nfce/lib/product_list#render-with_single_product.pdf +0 -0
  108. data/spec/fixtures/nfce/lib/product_list#render-with_single_product_and_long_name.pdf +0 -0
  109. data/spec/fixtures/nfce/lib/product_list_with_many_products_and_long_names.xml +2 -2
  110. data/spec/fixtures/nfce/lib/product_list_with_single_product_and_long_name.xml +1 -1
  111. data/spec/fixtures/nfce/lib/recipient#render-company.pdf +0 -0
  112. data/spec/fixtures/nfce/lib/recipient#render-consumer_without_document.pdf +0 -0
  113. data/spec/fixtures/nfce/lib/recipient#render-foreign.pdf +0 -0
  114. data/spec/fixtures/nfce/lib/recipient#render-individual.pdf +0 -0
  115. data/spec/fixtures/nfce/lib/recipient#render-unidentified_consumer.pdf +0 -0
  116. data/spec/fixtures/nfce/lib/total_list#does_not_render-payment_methods.pdf +0 -0
  117. data/spec/fixtures/nfce/lib/total_list#render-grouped_payment_methods.pdf +0 -0
  118. data/spec/fixtures/nfce/lib/total_list#render-totals.pdf +0 -0
  119. data/spec/fixtures/nfce/lib/total_list#render-without_payment.pdf +0 -0
  120. data/spec/fixtures/nfce/lib/total_list#render.pdf +0 -0
  121. data/spec/fixtures/nfce/v4.00/multiples_xmls_on_the_same_pdf.pdf +568 -447
  122. data/spec/fixtures/nfce/v4.00/nfce-unauthorized-hom.fixture.pdf +0 -0
  123. data/spec/fixtures/nfce/v4.00/nfce-unauthorized-prod.fixture.pdf +0 -0
  124. data/spec/fixtures/nfce/v4.00/rendered_nfce.fixture.pdf +0 -0
  125. data/spec/fixtures/nfce/v4.00/saved_nfce.fixture.pdf +0 -0
  126. data/spec/fixtures/qr_code/qr_code#render.pdf +0 -0
  127. data/spec/spec_helper.rb +1 -1
  128. metadata +118 -48
  129. data/lib/br_danfe/danfe_lib/nfce_lib/qr_code.rb +0 -25
  130. data/lib/br_danfe/danfe_lib/nfe_lib/cep.rb +0 -11
  131. data/spec/br_danfe/danfe_lib/nfce_lib/qr_code_spec.rb +0 -35
  132. data/spec/br_danfe/danfe_lib/nfe_lib/cep_spec.rb +0 -10
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe BrDanfe::DanfeLib::NfeLib::Cst do
4
4
  let(:xml_cst) do
5
- xml = <<-eos
5
+ xml = <<~XML
6
6
  <imposto>
7
7
  <ICMS>
8
8
  <ICMS00>
@@ -15,13 +15,13 @@ describe BrDanfe::DanfeLib::NfeLib::Cst do
15
15
  </ICMS00>
16
16
  </ICMS>
17
17
  </imposto>
18
- eos
18
+ XML
19
19
 
20
20
  Nokogiri::XML(xml)
21
21
  end
22
22
 
23
23
  let(:xml_csosn) do
24
- xml = <<-eos
24
+ xml = <<~XML
25
25
  <imposto>
26
26
  <ICMS>
27
27
  <ICMSSN102>
@@ -30,7 +30,7 @@ describe BrDanfe::DanfeLib::NfeLib::Cst do
30
30
  </ICMSSN102>
31
31
  </ICMS>
32
32
  </imposto>
33
- eos
33
+ XML
34
34
 
35
35
  Nokogiri::XML(xml)
36
36
  end
@@ -16,39 +16,39 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
16
16
 
17
17
  context "when nf-e's version is 2.00" do
18
18
  let(:xml_as_string) do
19
- <<-eos
20
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
21
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
22
- <ide>
23
- <dEmi>2011-10-29</dEmi>
24
- <dSaiEnt>2011-10-30</dSaiEnt>
25
- <hSaiEnt>15:32:45</hSaiEnt>
26
- </ide>
27
- <dest>
28
- <CNPJ>82743287000880</CNPJ>
29
- <xNome>Schneider Electric Brasil Ltda</xNome>
30
- <enderDest>
31
- <xLgr>Av da Saudade</xLgr>
32
- <nro>1125</nro>
33
- <xBairro>Frutal</xBairro>
34
- <xCpl>Sala 01 e 02</xCpl>
35
- <cMun>3552403</cMun>
36
- <xMun>SUMARE</xMun>
37
- <UF>SP</UF>
38
- <CEP>13171320</CEP>
39
- <cPais>1058</cPais>
40
- <xPais>BRASIL</xPais>
41
- <fone>1921046300</fone>
42
- </enderDest>
43
- <IE>671008375110</IE>
44
- </dest>
45
- </infNFe>
46
- </NFe>
47
- eos
19
+ <<~XML
20
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
21
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
22
+ <ide>
23
+ <dEmi>2011-10-29</dEmi>
24
+ <dSaiEnt>2011-10-30</dSaiEnt>
25
+ <hSaiEnt>15:32:45</hSaiEnt>
26
+ </ide>
27
+ <dest>
28
+ <CNPJ>82743287000880</CNPJ>
29
+ <xNome>Schneider Electric Brasil Ltda</xNome>
30
+ <enderDest>
31
+ <xLgr>Av da Saudade</xLgr>
32
+ <nro>1125</nro>
33
+ <xBairro>Frutal</xBairro>
34
+ <xCpl>Sala 01 e 02</xCpl>
35
+ <cMun>3552403</cMun>
36
+ <xMun>SUMARE</xMun>
37
+ <UF>SP</UF>
38
+ <CEP>13171320</CEP>
39
+ <cPais>1058</cPais>
40
+ <xPais>BRASIL</xPais>
41
+ <fone>1921046300</fone>
42
+ </enderDest>
43
+ <IE>671008375110</IE>
44
+ </dest>
45
+ </infNFe>
46
+ </NFe>
47
+ XML
48
48
  end
49
49
 
50
50
  it 'renders xml to the pdf' do
51
- expect(File.exist?(path_of_expected_pdf)).to eql false
51
+ expect(File.exist?(path_of_expected_pdf)).to be false
52
52
 
53
53
  pdf.render_file path_of_expected_pdf
54
54
 
@@ -58,38 +58,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
58
58
 
59
59
  context "when nf-e's version is 3.10" do
60
60
  let(:xml_as_string) do
61
- <<-eos
62
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
63
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
64
- <ide>
65
- <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
66
- <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
67
- </ide>
68
- <dest>
69
- <CNPJ>82743287000880</CNPJ>
70
- <xNome>Schneider Electric Brasil Ltda</xNome>
71
- <enderDest>
72
- <xLgr>Av da Saudade</xLgr>
73
- <nro>1125</nro>
74
- <xBairro>Frutal</xBairro>
75
- <xCpl>Sala 01 e 02</xCpl>
76
- <cMun>3552403</cMun>
77
- <xMun>SUMARE</xMun>
78
- <UF>SP</UF>
79
- <CEP>13171320</CEP>
80
- <cPais>1058</cPais>
81
- <xPais>BRASIL</xPais>
82
- <fone>1921046300</fone>
83
- </enderDest>
84
- <IE>671008375110</IE>
85
- </dest>
86
- </infNFe>
87
- </NFe>
88
- eos
61
+ <<~XML
62
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
63
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
64
+ <ide>
65
+ <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
66
+ <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
67
+ </ide>
68
+ <dest>
69
+ <CNPJ>82743287000880</CNPJ>
70
+ <xNome>Schneider Electric Brasil Ltda</xNome>
71
+ <enderDest>
72
+ <xLgr>Av da Saudade</xLgr>
73
+ <nro>1125</nro>
74
+ <xBairro>Frutal</xBairro>
75
+ <xCpl>Sala 01 e 02</xCpl>
76
+ <cMun>3552403</cMun>
77
+ <xMun>SUMARE</xMun>
78
+ <UF>SP</UF>
79
+ <CEP>13171320</CEP>
80
+ <cPais>1058</cPais>
81
+ <xPais>BRASIL</xPais>
82
+ <fone>1921046300</fone>
83
+ </enderDest>
84
+ <IE>671008375110</IE>
85
+ </dest>
86
+ </infNFe>
87
+ </NFe>
88
+ XML
89
89
  end
90
90
 
91
91
  it 'renders xml to the pdf' do
92
- expect(File.exist?(path_of_expected_pdf)).to eql false
92
+ expect(File.exist?(path_of_expected_pdf)).to be false
93
93
 
94
94
  pdf.render_file path_of_expected_pdf
95
95
 
@@ -99,38 +99,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
99
99
 
100
100
  context "when nf-e's version is 4.00" do
101
101
  let(:xml_as_string) do
102
- <<-eos
103
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
104
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="4.00">
105
- <ide>
106
- <dhEmi>2018-07-30T13:30:59+00:00</dhEmi>
107
- <dhSaiEnt>2018-07-30T14:32:45-03:00</dhSaiEnt>
108
- </ide>
109
- <dest>
110
- <CNPJ>82743287000880</CNPJ>
111
- <xNome>Schneider Electric Brasil Ltda</xNome>
112
- <enderDest>
113
- <xLgr>Av da Saudade</xLgr>
114
- <nro>1125</nro>
115
- <xBairro>Frutal</xBairro>
116
- <xCpl>Sala 01 e 02</xCpl>
117
- <cMun>3552403</cMun>
118
- <xMun>SUMARE</xMun>
119
- <UF>SP</UF>
120
- <CEP>13171320</CEP>
121
- <cPais>1058</cPais>
122
- <xPais>BRASIL</xPais>
123
- <fone>1921046300</fone>
124
- </enderDest>
125
- <IE>671008375110</IE>
126
- </dest>
127
- </infNFe>
128
- </NFe>
129
- eos
102
+ <<~XML
103
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
104
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="4.00">
105
+ <ide>
106
+ <dhEmi>2018-07-30T13:30:59+00:00</dhEmi>
107
+ <dhSaiEnt>2018-07-30T14:32:45-03:00</dhSaiEnt>
108
+ </ide>
109
+ <dest>
110
+ <CNPJ>82743287000880</CNPJ>
111
+ <xNome>Schneider Electric Brasil Ltda</xNome>
112
+ <enderDest>
113
+ <xLgr>Av da Saudade</xLgr>
114
+ <nro>1125</nro>
115
+ <xBairro>Frutal</xBairro>
116
+ <xCpl>Sala 01 e 02</xCpl>
117
+ <cMun>3552403</cMun>
118
+ <xMun>SUMARE</xMun>
119
+ <UF>SP</UF>
120
+ <CEP>13171320</CEP>
121
+ <cPais>1058</cPais>
122
+ <xPais>BRASIL</xPais>
123
+ <fone>1921046300</fone>
124
+ </enderDest>
125
+ <IE>671008375110</IE>
126
+ </dest>
127
+ </infNFe>
128
+ </NFe>
129
+ XML
130
130
  end
131
131
 
132
132
  it 'renders xml to the pdf' do
133
- expect(File.exist?(path_of_expected_pdf)).to eql false
133
+ expect(File.exist?(path_of_expected_pdf)).to be false
134
134
 
135
135
  pdf.render_file path_of_expected_pdf
136
136
 
@@ -140,19 +140,19 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
140
140
 
141
141
  context 'when recipient has CNPJ' do
142
142
  let(:xml_as_string) do
143
- <<-eos
144
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
145
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
146
- <dest>
147
- <CNPJ>71058884000183</CNPJ>
148
- </dest>
149
- </infNFe>
150
- </NFe>
151
- eos
143
+ <<~XML
144
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
145
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
146
+ <dest>
147
+ <CNPJ>71058884000183</CNPJ>
148
+ </dest>
149
+ </infNFe>
150
+ </NFe>
151
+ XML
152
152
  end
153
153
 
154
154
  it 'renders xml to the pdf' do
155
- expect(File.exist?(path_of_expected_pdf)).to eql false
155
+ expect(File.exist?(path_of_expected_pdf)).to be false
156
156
 
157
157
  pdf.render_file path_of_expected_pdf
158
158
 
@@ -162,19 +162,19 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
162
162
 
163
163
  context 'when recipient has CPF' do
164
164
  let(:xml_as_string) do
165
- <<-eos
166
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
167
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
168
- <dest>
169
- <CPF>48532557457</CPF>
170
- </dest>
171
- </infNFe>
172
- </NFe>
173
- eos
165
+ <<~XML
166
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
167
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
168
+ <dest>
169
+ <CPF>48532557457</CPF>
170
+ </dest>
171
+ </infNFe>
172
+ </NFe>
173
+ XML
174
174
  end
175
175
 
176
176
  it 'renders xml to the pdf' do
177
- expect(File.exist?(path_of_expected_pdf)).to eql false
177
+ expect(File.exist?(path_of_expected_pdf)).to be false
178
178
 
179
179
  pdf.render_file path_of_expected_pdf
180
180
 
@@ -184,22 +184,22 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
184
184
 
185
185
  context 'when recipient has IE' do
186
186
  let(:xml_as_string) do
187
- <<-eos
188
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
189
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
190
- <dest>
191
- <enderDest>
192
- <UF>SP</UF>
193
- </enderDest>
194
- <IE>671008375110</IE>
195
- </dest>
196
- </infNFe>
197
- </NFe>
198
- eos
187
+ <<~XML
188
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
189
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
190
+ <dest>
191
+ <enderDest>
192
+ <UF>SP</UF>
193
+ </enderDest>
194
+ <IE>671008375110</IE>
195
+ </dest>
196
+ </infNFe>
197
+ </NFe>
198
+ XML
199
199
  end
200
200
 
201
201
  it 'renders xml to the pdf' do
202
- expect(File.exist?(path_of_expected_pdf)).to eql false
202
+ expect(File.exist?(path_of_expected_pdf)).to be false
203
203
 
204
204
  pdf.render_file path_of_expected_pdf
205
205
 
@@ -209,37 +209,37 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
209
209
 
210
210
  context "when recipient doesn't have address complement" do
211
211
  let(:xml_as_string) do
212
- <<-eos
213
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
214
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
215
- <ide>
216
- <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
217
- <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
218
- </ide>
219
- <dest>
220
- <CNPJ>82743287000880</CNPJ>
221
- <xNome>Schneider Electric Brasil Ltda</xNome>
222
- <enderDest>
223
- <xLgr>Av da Saudade</xLgr>
224
- <nro>1125</nro>
225
- <xBairro>Frutal</xBairro>
226
- <cMun>3552403</cMun>
227
- <xMun>SUMARE</xMun>
228
- <UF>SP</UF>
229
- <CEP>13171320</CEP>
230
- <cPais>1058</cPais>
231
- <xPais>BRASIL</xPais>
232
- <fone>1921046300</fone>
233
- </enderDest>
234
- <IE>671008375110</IE>
235
- </dest>
236
- </infNFe>
237
- </NFe>
238
- eos
212
+ <<~XML
213
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
214
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
215
+ <ide>
216
+ <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
217
+ <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
218
+ </ide>
219
+ <dest>
220
+ <CNPJ>82743287000880</CNPJ>
221
+ <xNome>Schneider Electric Brasil Ltda</xNome>
222
+ <enderDest>
223
+ <xLgr>Av da Saudade</xLgr>
224
+ <nro>1125</nro>
225
+ <xBairro>Frutal</xBairro>
226
+ <cMun>3552403</cMun>
227
+ <xMun>SUMARE</xMun>
228
+ <UF>SP</UF>
229
+ <CEP>13171320</CEP>
230
+ <cPais>1058</cPais>
231
+ <xPais>BRASIL</xPais>
232
+ <fone>1921046300</fone>
233
+ </enderDest>
234
+ <IE>671008375110</IE>
235
+ </dest>
236
+ </infNFe>
237
+ </NFe>
238
+ XML
239
239
  end
240
240
 
241
241
  it 'renders xml to the pdf' do
242
- expect(File.exist?(path_of_expected_pdf)).to eql false
242
+ expect(File.exist?(path_of_expected_pdf)).to be false
243
243
 
244
244
  pdf.render_file path_of_expected_pdf
245
245
 
@@ -250,38 +250,38 @@ describe BrDanfe::DanfeLib::NfeLib::Dest do
250
250
 
251
251
  context 'when recipient address (xLgr + nro + xCpl) has more than 63 characters' do
252
252
  let(:xml_as_string) do
253
- <<-eos
254
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
255
- <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
256
- <ide>
257
- <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
258
- <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
259
- </ide>
260
- <dest>
261
- <CNPJ>82743287000880</CNPJ>
262
- <xNome>Schneider Electric Brasil Ltda</xNome>
263
- <enderDest>
264
- <xLgr>Rua do governo do estado</xLgr>
265
- <nro>1125</nro>
266
- <xCpl>Em anexo ao super mercado maior do bairro</xCpl>
267
- <xBairro>Frutal</xBairro>
268
- <cMun>3552403</cMun>
269
- <xMun>SUMARE</xMun>
270
- <UF>SP</UF>
271
- <CEP>13171320</CEP>
272
- <cPais>1058</cPais>
273
- <xPais>BRASIL</xPais>
274
- <fone>1921046300</fone>
275
- </enderDest>
276
- <IE>671008375110</IE>
277
- </dest>
278
- </infNFe>
279
- </NFe>
280
- eos
253
+ <<~XML
254
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
255
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="3.10">
256
+ <ide>
257
+ <dhEmi>2011-09-29T13:02:59+00:00</dhEmi>
258
+ <dhSaiEnt>2011-09-30T12:32:45-03:00</dhSaiEnt>
259
+ </ide>
260
+ <dest>
261
+ <CNPJ>82743287000880</CNPJ>
262
+ <xNome>Schneider Electric Brasil Ltda</xNome>
263
+ <enderDest>
264
+ <xLgr>Rua do governo do estado</xLgr>
265
+ <nro>1125</nro>
266
+ <xCpl>Em anexo ao super mercado maior do bairro</xCpl>
267
+ <xBairro>Frutal</xBairro>
268
+ <cMun>3552403</cMun>
269
+ <xMun>SUMARE</xMun>
270
+ <UF>SP</UF>
271
+ <CEP>13171320</CEP>
272
+ <cPais>1058</cPais>
273
+ <xPais>BRASIL</xPais>
274
+ <fone>1921046300</fone>
275
+ </enderDest>
276
+ <IE>671008375110</IE>
277
+ </dest>
278
+ </infNFe>
279
+ </NFe>
280
+ XML
281
281
  end
282
282
 
283
283
  it 'renders xml to pdf discarding the address of after 63 characters' do
284
- expect(File.exist?(path_of_expected_pdf)).to eql false
284
+ expect(File.exist?(path_of_expected_pdf)).to be false
285
285
 
286
286
  pdf.render_file path_of_expected_pdf
287
287