Socket
Book a DemoInstallSign in
Socket

test-unit-pdf_matcher

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-unit-pdf_matcher

1.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Test::Unit::PdfMatcher

Test

This gem provides assert_match_pdf assertion by PdfMatcher to Test::Unit.

Prerequisites

This gem requires diff-pdf. See the documentation of PdfMatcher for details.

Installation

Add this line to your application's Gemfile:

gem 'test-unit-pdf_matcher'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install test-unit-pdf_matcher

Usage

Add this line to your test_helper.rb:

require 'test/unit/pdf_matcher`

assert_match_pdf

assert_match_pdf pdf1_data, pdf2_data
assert_match_pdf '/path/to/1.pdf', '/path/to/2.pdf'
assert_match_pdf Pathnae('/path/to/1.pdf'), Pathname('/path/to/2.pdf')

You can generate a difference PDF by output_diff_path option:

assert_match_pdf pdf1_data, pdf2_data, output_diff_path: '/path/to/diff.pdf'

Configuring diff-pdf command options

::PdfMatcher.config.diff_pdf_opts = %w(--dpi=300 --grayscale)

See diff-pdf --help for the available diff-pdf options.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 03 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.