<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello!<div class=""><br class=""></div><div class="">Maybe consider something like Wraith or Gatling to do diffs on screenshots of the PDF:</div><div class=""><br class=""></div><div class="">  <a href="http://bbc-news.github.io/wraith/" class="">http://bbc-news.github.io/wraith/</a></div><div class="">  <a href="https://github.com/gabrielrotbart/gatling" class="">https://github.com/gabrielrotbart/gatling</a></div><div class=""><br class=""></div><div class="">Not sure quite how it’ll work with PDFs - think they’re normally aimed at HTML/CSS/JS, but this is where I’d start.</div><div class=""><br class=""></div><div class="">Good luck - and let us know how you get on!</div><div class=""><br class=""><div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">C</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">--<br class="">Barking Iguana Ltd. is a company registered in England and Wales.<br class="">Registered number: 08915147. Registered address: Jubilee House, East Beach, Lytham, St. Annes, Lancashire, England, FY8 5FT.</div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 1 Aug 2017, at 20:00, Mark Burns <<a href="mailto:markthedeveloper@gmail.com" class="">markthedeveloper@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Has anyone any recommendations or suggestions for testing PDF generation?<div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">But so far I've been tweaking then looking at the result in the browser.</div><div class="">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 class=""><br class=""></div><div class="">The DSL is nice, but very imperative. Mocking method calls out would be insane.</div><div class=""><br class=""></div><div class="">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 class=""><br class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class="">Chat mailing list<br class=""><a href="mailto:Chat@lists.lrug.org" class="">Chat@lists.lrug.org</a><br class="">Archives: http://lists.lrug.org/pipermail/chat-lrug.org<br class="">Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org<br class="">List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org<br class=""></div></blockquote></div><br class=""></div></body></html>