File: spec_helper.rb

package info (click to toggle)
ruby-pdf-core 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 408 kB
  • sloc: ruby: 2,270; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 629 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

puts "PDF::Core specs: Running on Ruby Version: #{RUBY_VERSION}"

require 'pdf/core'

require 'rspec'
require 'securerandom'
require 'pdf/reader'
require 'pdf/inspector'

# rubocop: disable Style/SymbolProc
RSpec.configure do |config|
  config.disable_monkey_patching!
end
# rubocop: enable Style/SymbolProc

RSpec::Matchers.define(:have_parseable_xobjects) do
  match do |actual|
    expect { PDF::Inspector::XObject.analyze(actual.render) }.to_not raise_error
    true
  end
  failure_message_for_should do |actual|
    "expected that #{actual}'s XObjects could be successfully parsed"
  end
end