diff --git a/spec/support/inputs_helper.rb b/spec/support/inputs_helper.rb index 564af75..f0cfad3 100644 --- a/spec/support/inputs_helper.rb +++ b/spec/support/inputs_helper.rb @@ -65,8 +65,7 @@ def cleanup_file_content!(text) :ids => /\/ID \[<\w*><\w*>\]/, # Remove ID values ex: /ID [<4ba02a4cf55b1fc842299e6f01eb838e><33bec7dc37839cadf7ab76f3be4d4306>] :stream => /stream .* 9|10 0 obj /m, # Remove some binary stream :content => /\/Contents \[.*\]/, - :xref => /^\d{10} \d{5} n|f $/, # Remove Cross-references dictionnary - :outputs => /^\<.*\:(.*)\>/ # Remove file path referrences + :xref => /^\d{10} \d{5} n|f $/ # Remove Cross-references dictionnary } @filter.each do |k,reg| if reg.source.respond_to? :encode diff --git a/spec/support/matchers/content_matcher.rb b/spec/support/matchers/content_matcher.rb index c85e75f..fc0b2c1 100644 --- a/spec/support/matchers/content_matcher.rb +++ b/spec/support/matchers/content_matcher.rb @@ -7,6 +7,12 @@ RSpec::Matchers.define :look_like_the_same_pdf_as do |expected| match do |actual| + if sha256_hash_of_almost(actual) != sha256_hash_of_almost(expected) + puts "Actual" + puts actual + puts "Expected" + puts expected + end sha256_hash_of_almost(actual) == sha256_hash_of_almost(expected) end diffable