Update terminalimageviewer.rb

This commit is contained in:
Aaron Liu 2021-07-21 13:29:56 +08:00 committed by Stefan Haustein
parent c0fd4ed19e
commit bbe4e5e0b0

View file

@ -4,6 +4,7 @@ class Terminalimageviewer < Formula
url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.1.0.tar.gz"
sha256 "727ddaa048643cb0a13e23bc308415060d99d8b1853883ad339ad7b952050d61"
head "https://github.com/stefanhaustein/TerminalImageViewer.git"
uses_from_macos "curl" => :test
depends_on "gcc" => :build unless OS.linux?
depends_on "imagemagick"
@ -30,8 +31,10 @@ class Terminalimageviewer < Formula
test do
# Downloads a public domain test file from wikimedia commons and displays it.
# For some reason, when you redirect the output it is blank.
assert_equal "",
shell_output("#{bin}/tiv -0 https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png").strip
# NOTE: Test will fail. Will fix when I get to my mac.
system "curl -o \"test.png\" https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png"
assert_equal "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
",
shell_output("#{bin}/tiv -0 -w 400 -h 400 test.png").strip
end
end