Skip to content

Commit

Permalink
last change wasn't it, lets inspect the outputs if they don't match
Browse files Browse the repository at this point in the history
  • Loading branch information
tcocca committed Jul 1, 2012
1 parent 6ac887c commit 81b354e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions spec/support/inputs_helper.rb
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spec/support/matchers/content_matcher.rb
Expand Up @@ -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
Expand Down

0 comments on commit 81b354e

Please sign in to comment.