Skip to content

Commit

Permalink
pdf-redact-tools: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
DomT4 committed Sep 8, 2018
1 parent bb15196 commit db6adba
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Formula/pdf-redact-tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ def install
end

test do
# Modifies the file in the directory the file is placed in.
cp test_fixtures("test.pdf"), "test.pdf"
system bin/"pdf-redact-tools", "-e", "test.pdf"
assert_predicate testpath/"test_pages/page-0.png", :exist?
rm_rf "test_pages"

system bin/"pdf-redact-tools", "-s", "test.pdf"
assert_predicate testpath/"test-final.pdf", :exist?
# Ensures pdf-redact-tools correctly recognises the file isn't a
# PDF and exits. Cannot test further than this without loosening
# our default imagemagick security policy.
cp test_fixtures("test.png"), "test"
output = shell_output("#{bin}/pdf-redact-tools --sanitize test 2>&1", 2)
assert_match "file must be a PDF", output
end
end

0 comments on commit db6adba

Please sign in to comment.