Sha256: 5675f71310556aa47bda2ec6f8441542be9242c9546b043bcb47137f7a9412fb

Contents?: true

Size: 369 Bytes

Versions: 114

Compression:

Stored size: 369 Bytes

Contents

# frozen_string_literal: true

# Matches PDF::Reader::Page text
RSpec::Matchers.define :have_pdf_page_text do |expected|
  match do |actual|
    actual
      .text
      .gsub(/(\n)+/, " ")
      .gsub(/(\t)+/, " ")
      .gsub(/( )+/, " ") =~ Regexp.new(expected)
  end
  failure_message do |actual|
    "expected that #{actual} would have text #{expected}"
  end
end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
renalware-core-2.0.147 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.146 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.145 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.144 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.143 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.142 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.141 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.140 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.139 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.138 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.137 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.136 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.135 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.134 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.133 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.132 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.131 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.130 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.129 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.128 spec/support/matchers/have_pdf_page_text.rb