Sha256: fe05d661fdca4a12b07f13a1e72d3a1cbe0b77eb6d47044a8716405f5b09f77c
Contents?: true
Size: 795 Bytes
Versions: 16
Compression:
Stored size: 795 Bytes
Contents
require 'test_helper' require 'ndr_import/helpers/file/pdf' # PDF file helper tests class PdfTest < ActiveSupport::TestCase # This is a test importer class to test the PDF file helper mixin class TestImporter include NdrImport::Helpers::File::Pdf end def setup @permanent_test_files = SafePath.new('permanent_test_files') @importer = TestImporter.new end test 'read_pdf_file helper should read pdf file' do file_content = @importer.send(:read_pdf_file, @permanent_test_files.join('hello_world.pdf')) assert_equal file_content, ['Hello World'] end test 'read_pdf_file helper should raise exception on invalid pdf file' do assert_raises RuntimeError do @importer.send(:read_pdf_file, @permanent_test_files.join('not_a_pdf.pdf')) end end end
Version data entries
16 entries across 16 versions & 1 rubygems