Class: PdfSpec::Matchers::IdenticalPdfs
- Inherits:
-
Object
- Object
- PdfSpec::Matchers::IdenticalPdfs
- Defined in:
- lib/pdf_spec/matchers.rb
Overview
Class that conforms to RSpec specifications for matchers
Instance Method Summary collapse
-
#failure_message ⇒ Object
:nodoc:.
-
#initialize(pdf_data) ⇒ IdenticalPdfs
constructor
A new instance of IdenticalPdfs.
-
#matches?(pdf_data) ⇒ Boolean
Compares given PDF data against.
-
#negative_failure_message ⇒ Object
:nodoc:.
Constructor Details
#initialize(pdf_data) ⇒ IdenticalPdfs
Returns a new instance of IdenticalPdfs.
7 8 9 |
# File 'lib/pdf_spec/matchers.rb', line 7 def initialize(pdf_data) @expected_pages = pdf_to_pixel_pages(pdf_data) end |
Instance Method Details
#failure_message ⇒ Object
:nodoc:
19 20 21 |
# File 'lib/pdf_spec/matchers.rb', line 19 def # :nodoc: "expected #{@target_pages.inspect} to look the same as #{@expected_pages.inspect}" end |
#matches?(pdf_data) ⇒ Boolean
Compares given PDF data against
14 15 16 17 |
# File 'lib/pdf_spec/matchers.rb', line 14 def matches?(pdf_data) @target_pages = pdf_to_pixel_pages(pdf_data) @target_pages == @expected_pages end |
#negative_failure_message ⇒ Object
:nodoc:
23 24 25 |
# File 'lib/pdf_spec/matchers.rb', line 23 def # :nodoc: "expected #{@target_pages.inspect} not to look the same as #{@expected_pages.inspect}" end |