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.1.1 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.1.0 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.167 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.166 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.165 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.164 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.163 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.162 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.161 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.160 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.159 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.158 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.157 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.156 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.155 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.153 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.152 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.151 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.149 spec/support/matchers/have_pdf_page_text.rb
renalware-core-2.0.148 spec/support/matchers/have_pdf_page_text.rb