This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
||||
require "ezdoc"
|
||||
require "notare"
|
||||
require "minitest/autorun"
|
||||
require "tempfile"
|
||||
require "zip"
|
||||
|
||||
module EzdocTestHelpers
|
||||
module NotareTestHelpers
|
||||
# Helper to create a document and return the document.xml content
|
||||
def create_doc_and_read_xml(&block)
|
||||
content = nil
|
||||
Tempfile.create(["test", ".docx"]) do |file|
|
||||
Ezdoc::Document.create(file.path, &block)
|
||||
Notare::Document.create(file.path, &block)
|
||||
Zip::File.open(file.path) do |zip|
|
||||
content = zip.read("word/document.xml").force_encoding("UTF-8")
|
||||
end
|
||||
@@ -23,7 +23,7 @@ module EzdocTestHelpers
|
||||
def create_doc_and_read_all_xml(&block)
|
||||
result = {}
|
||||
Tempfile.create(["test", ".docx"]) do |file|
|
||||
Ezdoc::Document.create(file.path, &block)
|
||||
Notare::Document.create(file.path, &block)
|
||||
Zip::File.open(file.path) do |zip|
|
||||
zip.each do |entry|
|
||||
if entry.name.end_with?(".xml") || entry.name.end_with?(".rels")
|
||||
|
||||
Reference in New Issue
Block a user