title: PDF Reader Cucumber Ruby
body: <p>I've been asked to write some tests to confirm text is contained within a PDF file.  I've come across the PDF reader gem which is all good at rendering text from the file except the output isn't too good.  I have a piece of text for example, that should read <code>Date of first registration of the product</code> but PDF reader sees this as <code>Date offirstregistrationoftheproduct</code>.  Thus when I run my assertion, it fails due to the spacing of the text.</p>
  
  <p>My code:</p>
  
  <pre><code>expected_text = 'Date of first registration of the product'
  
  file = File.open(my_pdf, "rb")
    PDF::Reader.open(file) do |reader|
      reader.pages.each do |page|
         expect(page).to have_text expected_text
      end
  </code></pre>
  
  <p>The result is an RSpec expectation not met error.</p>
  
  <p>Is there a way I can get this text properly formatted so that my assertion can read it?</p>