From: Kouhei S. <nu...@co...> - 2017-07-31 03:28:08
|
Kouhei Sutou 2017-07-31 12:27:28 +0900 (Mon, 31 Jul 2017) New Revision: 58b3706ccf6960e46715055f8f1aa0ed3d9a40dd https://github.com/ruby-gnome2/ruby-gnome2/commit/58b3706ccf6960e46715055f8f1aa0ed3d9a40dd Message: poppler test: create a test PDF that has a text field Added files: poppler/test/fixtures/text-field.odt poppler/test/fixtures/text-field.pdf Modified files: poppler/test/poppler-test-utils.rb poppler/test/test-document.rb Added: poppler/test/fixtures/text-field.odt (+0 -0) 100644 =================================================================== (Binary files differ) Added: poppler/test/fixtures/text-field.pdf (+0 -0) 100644 =================================================================== (Binary files differ) Modified: poppler/test/poppler-test-utils.rb (+4 -0) =================================================================== --- poppler/test/poppler-test-utils.rb 2017-07-31 12:23:43 +0900 (e404ae7) +++ poppler/test/poppler-test-utils.rb 2017-07-31 12:27:28 +0900 (7aed169) @@ -34,6 +34,10 @@ module PopplerTestUtils path end + def text_field_pdf + fixture_path("text-field.pdf") + end + def image_pdf fixture_path("image.pdf") end Modified: poppler/test/test-document.rb (+2 -2) =================================================================== --- poppler/test/test-document.rb 2017-07-31 12:23:43 +0900 (e57b199) +++ poppler/test/test-document.rb 2017-07-31 12:27:28 +0900 (1cb4f41) @@ -3,7 +3,7 @@ class TestDocument < Test::Unit::TestCase saved_pdf = File.join(tmp_dir, "saved.pdf") FileUtils.rm_f(saved_pdf) - document = Poppler::Document.new(form_pdf) + document = Poppler::Document.new(text_field_pdf) find_first_text_field(document).text = "XXX" document.save(saved_pdf) reread_document = Poppler::Document.new(saved_pdf) @@ -14,7 +14,7 @@ class TestDocument < Test::Unit::TestCase copied_pdf = File.join(tmp_dir, "copied.pdf") FileUtils.rm_f(copied_pdf) - document = Poppler::Document.new(form_pdf) + document = Poppler::Document.new(text_field_pdf) first_text_field = find_first_text_field(document) default_text = first_text_field.text first_text_field.text = "XXX" |