Project rename
All checks were successful
CI Pipeline / build (push) Successful in 12s

This commit is contained in:
2025-12-02 13:21:13 +01:00
parent 29ebb9a8d1
commit dec346254c
36 changed files with 114 additions and 114 deletions

View File

@@ -3,11 +3,11 @@
require "test_helper"
class DocumentTest < Minitest::Test
include EzdocTestHelpers
include NotareTestHelpers
def test_creates_valid_docx_structure
Tempfile.create(["test", ".docx"]) do |file|
Ezdoc::Document.create(file.path) do |doc|
Notare::Document.create(file.path) do |doc|
doc.p "Test"
end
@@ -33,7 +33,7 @@ class DocumentTest < Minitest::Test
def test_empty_document
Tempfile.create(["test", ".docx"]) do |file|
Ezdoc::Document.create(file.path) { |_doc| } # rubocop:disable Lint/EmptyBlock
Notare::Document.create(file.path) { |_doc| } # rubocop:disable Lint/EmptyBlock
assert File.exist?(file.path)
Zip::File.open(file.path) do |zip|
@@ -45,30 +45,30 @@ class DocumentTest < Minitest::Test
def test_document_create_returns_document
result = nil
Tempfile.create(["test", ".docx"]) do |file|
result = Ezdoc::Document.create(file.path) do |doc|
result = Notare::Document.create(file.path) do |doc|
doc.p "Test"
end
end
assert_instance_of Ezdoc::Document, result
assert_instance_of Notare::Document, result
end
def test_document_has_nodes
doc = Ezdoc::Document.new
doc = Notare::Document.new
doc.p "Test"
assert_equal 1, doc.nodes.count
assert_instance_of Ezdoc::Nodes::Paragraph, doc.nodes.first
assert_instance_of Notare::Nodes::Paragraph, doc.nodes.first
end
def test_document_lists_helper
doc = Ezdoc::Document.new
doc = Notare::Document.new
doc.p "Paragraph"
doc.ul { doc.li "Bullet" }
doc.ol { doc.li "Number" }
doc.table { doc.tr { doc.td "Cell" } }
assert_equal 2, doc.lists.count
assert(doc.lists.all? { |l| l.is_a?(Ezdoc::Nodes::List) })
assert(doc.lists.all? { |l| l.is_a?(Notare::Nodes::List) })
end
end