test/hexapdf/test_writer.rb in hexapdf-0.2.0 vs test/hexapdf/test_writer.rb in hexapdf-0.3.0
- old
+ new
@@ -38,11 +38,11 @@
<</Size 3/Prev 54>>
startxref
219
%%EOF
3 0 obj
-<</Producer(HexaPDF version 0.2.0)>>
+<</Producer(HexaPDF version 0.3.0)>>
endobj
xref
3 1
0000000296 00000 n
trailer
@@ -70,11 +70,11 @@
endobj
startxref
141
%%EOF
6 0 obj
-<</Producer(HexaPDF version 0.2.0)>>
+<</Producer(HexaPDF version 0.3.0)>>
endobj
2 0 obj
<</Length 10>>stream
Some data!
endstream
@@ -114,7 +114,16 @@
io = StringIO.new
writer = HexaPDF::Writer.new(document, io)
xref_section = HexaPDF::XRefSection.new
xref_section.add_compressed_entry(1, 2, 3)
assert_raises(HexaPDF::Error) { writer.send(:write_xref_section, xref_section) }
+ end
+
+ it "removes the /XRefStm entry in a trailer" do
+ io = StringIO.new
+ doc = HexaPDF::Document.new
+ doc.trailer[:XRefStm] = 1234
+ doc.write(io)
+ doc = HexaPDF::Document.new(io: io)
+ refute(doc.trailer.key?(:XRefStm))
end
end