require 'spec_helper' describe BrDanfe::MdfeLib::Drivers do let(:xml_as_string) do <<~XML RQM8B64 01259587867 0 1500 0 EDUARDO DANIEL 11585756709 04 02 ES RVA1B90 123456789 0 1500 0 JOAO DA SILVA 9876654312 04 02 SC DFE4U78 045784572 0 1500 0 ANTÔNIO DA SILVA 9856478238 04 02 SC XML end let(:pdf) { BrDanfe::MdfeLib::Document.new } let(:xml) { BrDanfe::XML.new(xml_as_string) } subject { described_class.new(pdf, xml) } let(:pdf_text) do PDF::Inspector::Text.analyze(pdf.render).strings.join("\n") end describe '#generate' do it 'generates the title' do title = 'Condutor' subject.generate expect(pdf_text).to include title end it 'generates the title of table' do cpf = 'CPF' name = 'Nome' subject.generate expect(pdf_text).to include cpf, name end end end