<div dir="ltr">Mark, a suggestion not yet mentioned -<div><br>HexaPDF - A Versatile PDF Creation and Manipulation Library for Ruby</div><div><br></div><div><a href="https://hexapdf.gettalong.org/">https://hexapdf.gettalong.org/</a><br><a href="https://github.com/gettalong/hexapdf">https://github.com/gettalong/hexapdf</a></div><div><br></div><div>for testing (and/or generating) your PDFs.</div><div><br></div><div><br></div><div>Jason.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 2, 2017 at 5:00 AM, Mark Burns <span dir="ltr"><<a href="mailto:markthedeveloper@gmail.com" target="_blank">markthedeveloper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Has anyone any recommendations or suggestions for testing PDF generation?<div><br></div><div>I'm working on a side project and using Prawn. Which is great. I can programmatically generate large aspects of the content I want.</div><div><br></div><div>But so far I've been tweaking then looking at the result in the browser.</div><div>It's not an absolute nightmare - a few seconds to render. But it's hard to know whether the result is working without actually looking at it.</div><div><br></div><div>The DSL is nice, but very imperative. Mocking method calls out would be insane.</div><div><br></div><div>I'm managing to refactor into small objects to represent the components and layout, pages, typography aspects etc of the document. Which brings the complexity back down to manageable chunks. <br><br>But ultimately everything just calls underlying prawn DSL methods. So I can test little bits of logic that I have in my objects, but ultimately whether it works or not comes down to "have a look and see".</div><div><br></div><div>Perhaps the best I can hope for is screenshotting when I'm happy and using approvals to verify each major change hasn't radically borked everything.</div><div><br></div><div>It seems like there are tools to test which strings get into the document, but that seems like the easiest part. And probably the only part I'd be happy with test doubles for prawn and setting expectations on the text generating methods.</div></div>
<br>______________________________<wbr>_________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/<wbr>pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.<wbr>cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/<wbr>listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div>